X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=crypto%2Fscatterwalk.c;h=2953e2cc56f08c1af4fce898b991ad8e26011311;hb=43bc926fffd92024b46cafaf7350d669ba9ca884;hp=50c9461e8cc6afc03e5497c065ce92bc7653d5c3;hpb=f7f1b0f1e2fbadeab12d24236000e778aa9b1ead;p=linux-2.6.git diff --git a/crypto/scatterwalk.c b/crypto/scatterwalk.c index 50c9461e8..2953e2cc5 100644 --- a/crypto/scatterwalk.c +++ b/crypto/scatterwalk.c @@ -17,7 +17,6 @@ #include #include #include -#include #include #include "internal.h" #include "scatterwalk.h" @@ -100,7 +99,7 @@ void scatterwalk_done(struct scatter_walk *walk, int out, int more) int scatterwalk_copychunks(void *buf, struct scatter_walk *walk, size_t nbytes, int out) { - do { + while (nbytes > walk->len_this_page) { memcpy_dir(buf, walk->data, walk->len_this_page, out); buf += walk->len_this_page; nbytes -= walk->len_this_page; @@ -108,7 +107,7 @@ int scatterwalk_copychunks(void *buf, struct scatter_walk *walk, scatterwalk_unmap(walk, out); scatterwalk_pagedone(walk, out, 1); scatterwalk_map(walk, out); - } while (nbytes > walk->len_this_page); + } memcpy_dir(buf, walk->data, nbytes, out); return nbytes;