Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

lib/scatterlist: use sg_phys() helper

This shorten the length of code in horizential direction, therefore is
easier to read.

Link: https://lkml.kernel.org/r/20241028182920.1025819-1-sui.jingfeng@linux.dev
Signed-off-by: Sui Jingfeng <sui.jingfeng@linux.dev>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

Sui Jingfeng and committed by
Andrew Morton
e01caa2b 2f07b652

+2 -2
+2 -2
lib/scatterlist.c
··· 474 474 return -EOPNOTSUPP; 475 475 476 476 if (sgt_append->prv) { 477 - unsigned long next_pfn = (page_to_phys(sg_page(sgt_append->prv)) + 478 - sgt_append->prv->offset + sgt_append->prv->length) / PAGE_SIZE; 477 + unsigned long next_pfn; 479 478 480 479 if (WARN_ON(offset)) 481 480 return -EINVAL; 482 481 483 482 /* Merge contiguous pages into the last SG */ 484 483 prv_len = sgt_append->prv->length; 484 + next_pfn = (sg_phys(sgt_append->prv) + prv_len) / PAGE_SIZE; 485 485 if (page_to_pfn(pages[0]) == next_pfn) { 486 486 last_pg = pfn_to_page(next_pfn - 1); 487 487 while (n_pages && pages_are_mergeable(pages[0], last_pg)) {