summaryrefslogtreecommitdiff
path: root/include/crypto
diff options
context:
space:
mode:
authorDavid Hildenbrand <david@redhat.com>2025-09-01 17:03:54 +0200
committerAndrew Morton <akpm@linux-foundation.org>2025-09-21 14:22:09 -0700
commitce00897b94bc5c62fab962625efcf1ab824d3688 (patch)
treefc5e8f2b58b764098807da9c74e4512f8614a973 /include/crypto
parentfae6406bca03688bde691ef7f2605165d6b4f9b8 (diff)
crypto: remove nth_page() usage within SG entry
It's no longer required to use nth_page() when iterating pages within a single SG entry, so let's drop the nth_page() usage. Link: https://lkml.kernel.org/r/20250901150359.867252-34-david@redhat.com Signed-off-by: David Hildenbrand <david@redhat.com> Reviewed-by: Lorenzo Stoakes <lorenzo.stoakes@oracle.com> Acked-by: Herbert Xu <herbert@gondor.apana.org.au> Cc: "David S. Miller" <davem@davemloft.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'include/crypto')
-rw-r--r--include/crypto/scatterwalk.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/crypto/scatterwalk.h b/include/crypto/scatterwalk.h
index 15ab743f68c8..83d14376ff2b 100644
--- a/include/crypto/scatterwalk.h
+++ b/include/crypto/scatterwalk.h
@@ -159,7 +159,7 @@ static inline void scatterwalk_map(struct scatter_walk *walk)
if (IS_ENABLED(CONFIG_HIGHMEM)) {
struct page *page;
- page = nth_page(base_page, offset >> PAGE_SHIFT);
+ page = base_page + (offset >> PAGE_SHIFT);
offset = offset_in_page(offset);
addr = kmap_local_page(page) + offset;
} else {
@@ -259,7 +259,7 @@ static inline void scatterwalk_done_dst(struct scatter_walk *walk,
end += (offset_in_page(offset) + offset_in_page(nbytes) +
PAGE_SIZE - 1) >> PAGE_SHIFT;
for (i = start; i < end; i++)
- flush_dcache_page(nth_page(base_page, i));
+ flush_dcache_page(base_page + i);
}
scatterwalk_advance(walk, nbytes);
}