]> err.no Git - linux-2.6/commitdiff
[MTD] Avoid 64-bit division in mtdconcat
authorAndrew Morton <akpm@osdl.org>
Sat, 20 May 2006 09:17:21 +0000 (10:17 +0100)
committerDavid Woodhouse <dwmw2@infradead.org>
Sat, 20 May 2006 09:17:21 +0000 (10:17 +0100)
WARNING: "__moddi3" [drivers/mtd/mtdconcat.ko] undefined!

Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
drivers/mtd/mtdconcat.c

index b7de90845c2d6a18c94d22b1efa5627da7089ed8..3c61a980c56cd13f7206df4ddbf1b66f4962eeb3 100644 (file)
@@ -19,6 +19,8 @@
 #include <linux/mtd/mtd.h>
 #include <linux/mtd/concat.h>
 
+#include <asm/div64.h>
+
 /*
  * Our storage structure:
  * Subdev points to an array of pointers to struct mtd_info objects
@@ -276,9 +278,11 @@ concat_writev_ecc(struct mtd_info *mtd, const struct kvec *vecs,
                return -EINVAL;
 
        /* Check alignment */
-       if (mtd->oobblock > 1)
-               if ((to % mtd->oobblock) || (total_len % mtd->oobblock))
+       if (mtd->oobblock > 1) {
+               loff_t __to = to;
+               if (do_div(__to, mtd->oobblock) || (total_len % mtd->oobblock))
                        return -EINVAL;
+       }
 
        /* make a copy of vecs */
        vecs_copy = kmalloc(sizeof(struct kvec) * count, GFP_KERNEL);