X-Git-Url: https://git.openpandora.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=crypto%2Fscatterwalk.c;h=2953e2cc56f08c1af4fce898b991ad8e26011311;hb=ca94f26d2b2ee8ad76be617b35f846444fedc07b;hp=50c9461e8cc6afc03e5497c065ce92bc7653d5c3;hpb=1da177e4c3f41524e886b7f1b8a0c1fc7321cac2;p=pandora-kernel.git diff --git a/crypto/scatterwalk.c b/crypto/scatterwalk.c index 50c9461e8cc6..2953e2cc56f0 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;