diff mbox

[U-Boot,4/5] JFFS2: Correct jffs2_1pass_build_lists to use lldiv

Message ID 1386272919-22615-4-git-send-email-trini@ti.com
State Accepted
Delegated to: Tom Rini
Headers show

Commit Message

Tom Rini Dec. 5, 2013, 7:48 p.m. UTC
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 |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Tom Rini Dec. 16, 2013, 2:16 p.m. UTC | #1
On Thu, Dec 05, 2013 at 02:48:38PM -0500, Tom Rini wrote:

> 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 |    4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)

Applied to u-boot/master, thanks!
diff mbox

Patch

diff --git a/fs/jffs2/jffs2_1pass.c b/fs/jffs2/jffs2_1pass.c
index c856983..3fb5db3 100644
--- a/fs/jffs2/jffs2_1pass.c
+++ b/fs/jffs2/jffs2_1pass.c
@@ -114,6 +114,7 @@ 
 #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. */