[U-Boot] [PATCH v3 10/26] fs: fat: support write with non-zero offset

Heinrich Schuchardt xypron.glpk at gmx.de
Wed Oct 31 20:54:14 UTC 2018


On 10/31/2018 01:22 PM, Alexander Graf wrote:
> On 10/31/2018 11:00 AM, Clément Péron wrote:
>> Hi,
>>
>> Trying to rebuild my SoCFPGA Cyclone V board and got this error :
>>
>> fs/built-in.o: In function `set_contents':
>> /home/cperon/u-boot/fs/fat/fat_write.c:831: undefined reference to
>> `__aeabi_ldivmod'
>> make: *** [Makefile:1381: u-boot] Error 1
>>
>> seems to be introduced with this operation :
>> assert(!(cur_pos % bytesperclust));
> 
> Could we maybe just use a bitmask for bytesperclust?
> 
> 
> Alex

According to the FAT specification the cluster size is a power of two.
So we can write

assert(!(cur_pos & (bytesperclust -1)));

Cf. patch
https://lists.denx.de/pipermail/u-boot/2018-October/346178.html
fs: fat: validate sector and cluster size.

Best regards

Heinrich


More information about the U-Boot mailing list