]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - crypto/scatterwalk.c
h63xx: tsc2101 alsa sound support
[linux-2.6-omap-h63xx.git] / crypto / scatterwalk.c
index 50c9461e8cc6afc03e5497c065ce92bc7653d5c3..2953e2cc56f08c1af4fce898b991ad8e26011311 100644 (file)
@@ -17,7 +17,6 @@
 #include <linux/mm.h>
 #include <linux/pagemap.h>
 #include <linux/highmem.h>
-#include <asm/bug.h>
 #include <asm/scatterlist.h>
 #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;