aboutsummaryrefslogtreecommitdiffstats
path: root/package/boot/uboot-omap/patches/002-fix_jffs2.patch
blob: 849c633221fb91d0ec9b9d033d7a5c7adbef7e54 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
Building boards that have JFFS2 support enabled will fail when using
U-Boot's builtin GCC library, for example like this:

USE_PRIVATE_LIBGCC=yes ./MAKEALL omap3_evm
...
fs/jffs2/libjffs2.o: In function `jffs2_1pass_build_lists':
fs/jffs2/jffs2_1pass.c:1441: undefined reference to `__aeabi_uldivmod'

This is caused by a u64 / u32 division in jffs2_1pass.c; the problem
can be avoided by using do_div() instead of plain division.

Signed-off-by: Wolfgang Denk <wd@denx.de>
Reported-by: Chris Ruehl <chris.ruehl@gtsys.com.hk>
Cc: Chris Ruehl <chris.ruehl@gtsys.com.hk>

---
 fs/jffs2/jffs2_1pass.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/fs/jffs2/jffs2_1pass.c
+++ b/fs/jffs2/jffs2_1pass.c
@@ -1438,7 +1438,7 @@ jffs2_1pass_build_lists(struct part_info
 {
 	struct b_lists *pL;
 	struct jffs2_unknown_node *node;
-	u32 nr_sectors = part->size/part->sector_size;
+	u32 nr_sectors = do_div(part->size, part->sector_size);
 	u32 i;
 	u32 counter4 = 0;
 	u32 counterF = 0;