002-fix_jffs2.patch 1.1 KB

12345678910111213141516171819202122232425262728293031323334
  1. Building boards that have JFFS2 support enabled will fail when using
  2. U-Boot's builtin GCC library, for example like this:
  3. USE_PRIVATE_LIBGCC=yes ./MAKEALL omap3_evm
  4. ...
  5. fs/jffs2/libjffs2.o: In function `jffs2_1pass_build_lists':
  6. fs/jffs2/jffs2_1pass.c:1441: undefined reference to `__aeabi_uldivmod'
  7. This is caused by a u64 / u32 division in jffs2_1pass.c; the problem
  8. can be avoided by using do_div() instead of plain division.
  9. Signed-off-by: Wolfgang Denk <wd@denx.de>
  10. Reported-by: Chris Ruehl <chris.ruehl@gtsys.com.hk>
  11. Cc: Chris Ruehl <chris.ruehl@gtsys.com.hk>
  12. ---
  13. fs/jffs2/jffs2_1pass.c | 2 +-
  14. 1 file changed, 1 insertion(+), 1 deletion(-)
  15. diff --git a/fs/jffs2/jffs2_1pass.c b/fs/jffs2/jffs2_1pass.c
  16. index c856983..a7dbe79 100644
  17. --- a/fs/jffs2/jffs2_1pass.c
  18. +++ b/fs/jffs2/jffs2_1pass.c
  19. @@ -1438,7 +1438,7 @@ jffs2_1pass_build_lists(struct part_info * part)
  20. {
  21. struct b_lists *pL;
  22. struct jffs2_unknown_node *node;
  23. - u32 nr_sectors = part->size/part->sector_size;
  24. + u32 nr_sectors = do_div(part->size, part->sector_size);
  25. u32 i;
  26. u32 counter4 = 0;
  27. u32 counterF = 0;
  28. --
  29. 1.8.3.1