aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/mtdconcat.c
diff options
context:
space:
mode:
authorAndrew Morton <akpm@osdl.org>2006-05-20 05:17:21 -0400
committerDavid Woodhouse <dwmw2@infradead.org>2006-05-20 05:17:21 -0400
commit6c8b44abc86a3e23dd1a22c0ee187f06bd7c7f5d (patch)
tree8b40f20e9c0dda7a52a39a14d131684d3549a3d3 /drivers/mtd/mtdconcat.c
parent5fc3dbc418e01345e25e96b3192a1c46051c3fdc (diff)
[MTD] Avoid 64-bit division in mtdconcat
WARNING: "__moddi3" [drivers/mtd/mtdconcat.ko] undefined! Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Diffstat (limited to 'drivers/mtd/mtdconcat.c')
-rw-r--r--drivers/mtd/mtdconcat.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/mtd/mtdconcat.c b/drivers/mtd/mtdconcat.c
index b7de90845c2d..3c61a980c56c 100644
--- a/drivers/mtd/mtdconcat.c
+++ b/drivers/mtd/mtdconcat.c
@@ -19,6 +19,8 @@
19#include <linux/mtd/mtd.h> 19#include <linux/mtd/mtd.h>
20#include <linux/mtd/concat.h> 20#include <linux/mtd/concat.h>
21 21
22#include <asm/div64.h>
23
22/* 24/*
23 * Our storage structure: 25 * Our storage structure:
24 * Subdev points to an array of pointers to struct mtd_info objects 26 * 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,
276 return -EINVAL; 278 return -EINVAL;
277 279
278 /* Check alignment */ 280 /* Check alignment */
279 if (mtd->oobblock > 1) 281 if (mtd->oobblock > 1) {
280 if ((to % mtd->oobblock) || (total_len % mtd->oobblock)) 282 loff_t __to = to;
283 if (do_div(__to, mtd->oobblock) || (total_len % mtd->oobblock))
281 return -EINVAL; 284 return -EINVAL;
285 }
282 286
283 /* make a copy of vecs */ 287 /* make a copy of vecs */
284 vecs_copy = kmalloc(sizeof(struct kvec) * count, GFP_KERNEL); 288 vecs_copy = kmalloc(sizeof(struct kvec) * count, GFP_KERNEL);