]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
crypto: scatterwalk - Remove unnecessary advance in scatterwalk_pagedone
authorHerbert Xu <herbert@gondor.apana.org.au>
Tue, 12 Jul 2016 05:17:58 +0000 (13:17 +0800)
committerChuck Anderson <chuck.anderson@oracle.com>
Sun, 26 Feb 2017 05:34:24 +0000 (21:34 -0800)
Orabug: 25243093

The offset advance in scatterwalk_pagedone not only is unnecessary,
but it was also buggy when it was needed by scatterwalk_copychunks.
As the latter has long ago been fixed to call scatterwalk_advance
directly, we can remove this unnecessary offset adjustment.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
(cherry picked from commit 28cf86fafdd663cfcad3c5a5fe9869f1fa01b472)
Signed-off-by: Ethan Zhao <ethan.zhao@oracle.com>
crypto/scatterwalk.c

index f285404cc215ad35d3c45a7946d881481159f9bd..bd0c8c065b85dd46e7d52dd31fd4d731946f1732 100644 (file)
@@ -55,12 +55,8 @@ static void scatterwalk_pagedone(struct scatter_walk *walk, int out,
                        flush_dcache_page(page);
        }
 
-       if (more) {
-               walk->offset += PAGE_SIZE - 1;
-               walk->offset &= PAGE_MASK;
-               if (walk->offset >= walk->sg->offset + walk->sg->length)
-                       scatterwalk_start(walk, sg_next(walk->sg));
-       }
+       if (more && walk->offset >= walk->sg->offset + walk->sg->length)
+               scatterwalk_start(walk, sg_next(walk->sg));
 }
 
 void scatterwalk_done(struct scatter_walk *walk, int out, int more)