]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
JFFS2: Correct jffs2_1pass_build_lists to use lldiv
authorTom Rini <trini@ti.com>
Thu, 5 Dec 2013 19:48:38 +0000 (14:48 -0500)
committerTom Rini <trini@ti.com>
Fri, 13 Dec 2013 14:16:20 +0000 (09:16 -0500)
Since part_info size became 64bit we need to use lldiv here.

Signed-off-by: Tom Rini <trini@ti.com>
fs/jffs2/jffs2_1pass.c

index c856983ef444bfb3292a5aa2efafdd18b489e3e5..3fb5db383ec9206fba37f5f4039f635b30c1cce0 100644 (file)
 #include <common.h>
 #include <config.h>
 #include <malloc.h>
+#include <div64.h>
 #include <linux/stat.h>
 #include <linux/time.h>
 #include <watchdog.h>
@@ -1438,7 +1439,7 @@ jffs2_1pass_build_lists(struct part_info * part)
 {
        struct b_lists *pL;
        struct jffs2_unknown_node *node;
-       u32 nr_sectors = part->size/part->sector_size;
+       u32 nr_sectors;
        u32 i;
        u32 counter4 = 0;
        u32 counterF = 0;
@@ -1447,6 +1448,7 @@ jffs2_1pass_build_lists(struct part_info * part)
        u32 buf_size = DEFAULT_EMPTY_SCAN_SIZE;
        char *buf;
 
+       nr_sectors = lldiv(part->size, part->sector_size);
        /* turn off the lcd.  Refreshing the lcd adds 50% overhead to the */
        /* jffs2 list building enterprise nope.  in newer versions the overhead is */
        /* only about 5 %.  not enough to inconvenience people for. */