]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
crypto: scatterwalk - remove obsolete functions
authorEric Biggers <ebiggers@google.com>
Wed, 19 Feb 2025 18:23:40 +0000 (10:23 -0800)
committerHerbert Xu <herbert@gondor.apana.org.au>
Sun, 2 Mar 2025 07:19:44 +0000 (15:19 +0800)
Remove various functions that are no longer used.

Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
crypto/scatterwalk.c
include/crypto/scatterwalk.h

index 2e7a532152d61f204fd4baaeefaac81d2b991cd0..87c080f565d45051e044e10f1a04374365e965ae 100644 (file)
@@ -30,43 +30,6 @@ void scatterwalk_skip(struct scatter_walk *walk, unsigned int nbytes)
 }
 EXPORT_SYMBOL_GPL(scatterwalk_skip);
 
-static inline void memcpy_dir(void *buf, void *sgdata, size_t nbytes, int out)
-{
-       void *src = out ? buf : sgdata;
-       void *dst = out ? sgdata : buf;
-
-       memcpy(dst, src, nbytes);
-}
-
-void scatterwalk_copychunks(void *buf, struct scatter_walk *walk,
-                           size_t nbytes, int out)
-{
-       for (;;) {
-               unsigned int len_this_page = scatterwalk_pagelen(walk);
-               u8 *vaddr;
-
-               if (len_this_page > nbytes)
-                       len_this_page = nbytes;
-
-               if (out != 2) {
-                       vaddr = scatterwalk_map(walk);
-                       memcpy_dir(buf, vaddr, len_this_page, out);
-                       scatterwalk_unmap(vaddr);
-               }
-
-               scatterwalk_advance(walk, len_this_page);
-
-               if (nbytes == len_this_page)
-                       break;
-
-               buf += len_this_page;
-               nbytes -= len_this_page;
-
-               scatterwalk_pagedone(walk, out & 1, 1);
-       }
-}
-EXPORT_SYMBOL_GPL(scatterwalk_copychunks);
-
 inline void memcpy_from_scatterwalk(void *buf, struct scatter_walk *walk,
                                    unsigned int nbytes)
 {
index f6262d05a3c75b287ec3035b38666bad76884498..ac03fdf88b2a018ead588a16f8a85384d4de9f27 100644 (file)
@@ -115,28 +115,6 @@ static inline void *scatterwalk_next(struct scatter_walk *walk,
        return scatterwalk_map(walk);
 }
 
-static inline void scatterwalk_pagedone(struct scatter_walk *walk, int out,
-                                       unsigned int more)
-{
-       if (out) {
-               struct page *page;
-
-               page = sg_page(walk->sg) + ((walk->offset - 1) >> PAGE_SHIFT);
-               flush_dcache_page(page);
-       }
-
-       if (more && walk->offset >= walk->sg->offset + walk->sg->length)
-               scatterwalk_start(walk, sg_next(walk->sg));
-}
-
-static inline void scatterwalk_done(struct scatter_walk *walk, int out,
-                                   int more)
-{
-       if (!more || walk->offset >= walk->sg->offset + walk->sg->length ||
-           !(walk->offset & (PAGE_SIZE - 1)))
-               scatterwalk_pagedone(walk, out, more);
-}
-
 static inline void scatterwalk_advance(struct scatter_walk *walk,
                                       unsigned int nbytes)
 {
@@ -184,9 +162,6 @@ static inline void scatterwalk_done_dst(struct scatter_walk *walk,
 
 void scatterwalk_skip(struct scatter_walk *walk, unsigned int nbytes);
 
-void scatterwalk_copychunks(void *buf, struct scatter_walk *walk,
-                           size_t nbytes, int out);
-
 void memcpy_from_scatterwalk(void *buf, struct scatter_walk *walk,
                             unsigned int nbytes);