]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
fs/squashfs: use lldiv function for math
authorKasper Revsbech <kasper.revsbech.ext@siemensgamesa.com>
Thu, 1 Dec 2022 15:30:32 +0000 (16:30 +0100)
committerTom Rini <trini@konsulko.com>
Thu, 8 Dec 2022 14:29:02 +0000 (09:29 -0500)
When compling for x86:
u-boot/fs/squashfs/sqfs.c:90: undefined reference to `__udivmoddi4'

Signed-off-by: Kasper Revsbech <kasper.revsbech.ext@siemensgamesa.com>
Tested-by: Sean Nyekjaer <sean@geanix.com>
fs/squashfs/sqfs.c

index 74ca70c3ff4ef063680707ab41c3b65a4bf985cb..422662192374fee35a42b4ab0eeb0582ad56e17a 100644 (file)
@@ -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);