fs/squashfs: use lldiv function for math
PATCH 1/1 fs/squashfs: use lldiv function for math
From: Kasper Revsbech <[email protected]>
When compling for x86:u-boot/fs/squashfs/sqfs.c:90: undefined reference to `__udivmoddi4'
Signed-off-by Kasper Revsbech <[email protected]>
--- fs/squashfs/sqfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/squashfs/sqfs.c +1 -1
@@ -87,7 +87,7 @@ static int sqfs_calc_n_blks(__le64 start, __le64 end, u64 *offset)u64 start_, table_size; table_size =le64_to_cpu (end) -le64_to_cpu (start); - start_ =le64_to_cpu (start) / ctxt.cur_dev->blksz; + start_ =lldiv (le64_to_cpu (start), ctxt.cur_dev->blksz); *offset =le64_to_cpu (start) - (start_ * ctxt.cur_dev->blksz);return DIV_ROUND_UP (table_size + *offset, ctxt.cur_dev->blksz);
Signature · 1 line
2.34.1
Quoting [email protected]:
Quoted 6 lines
From: Kasper Revsbech <[email protected]>
When compling for x86:
u-boot/fs/squashfs/sqfs.c:90: undefined reference to `__udivmoddi4'Signed-off-by Kasper Revsbech <[email protected]>
Tested-by Sean Nyekjaer <[email protected]>
Quoted 20 lines
--- fs/squashfs/sqfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)fs/squashfs/sqfs.c +1
-1@@ -87,7 +87,7 @@ static int sqfs_calc_n_blks(__le64 start, __le64 end, u64 *offset)u64 start_, table_size; table_size =le64_to_cpu (end) -le64_to_cpu (start); - start_ =le64_to_cpu (start) / ctxt.cur_dev->blksz; + start_ =lldiv (le64_to_cpu (start), ctxt.cur_dev->blksz); *offset =le64_to_cpu (start) - (start_ * ctxt.cur_dev->blksz);return
DIV_ROUND_UP(table_size + *offset, ctxt.cur_dev->blksz);
--
2.34.1
Quoted 7 lines · On Thu, Dec 01, 2022 at 04:30:32PM +0100, [email protected] wrote:
From: Kasper Revsbech <[email protected]>
When compling for x86:
u-boot/fs/squashfs/sqfs.c:90: undefined reference to `__udivmoddi4'Signed-off-by Kasper Revsbech <[email protected]>Tested-by Sean Nyekjaer <[email protected]>
Applied to u-boot/next, thanks!
Signature · 1 line
Tom