From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?UTF-8?B?Q2zDqW1lbnQgUMOpcm9u?= Date: Mon, 5 Nov 2018 17:44:40 +0100 Subject: [U-Boot] [PATCH v3 10/26] fs: fat: support write with non-zero offset In-Reply-To: <20181101051118.GM11663@linaro.org> References: <20180911065922.19141-1-takahiro.akashi@linaro.org> <20180911065922.19141-11-takahiro.akashi@linaro.org> <7602021b-50a2-392a-7da3-b9c7e2d2d716@ti.com> <20181101051118.GM11663@linaro.org> Message-ID: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit To: u-boot@lists.denx.de Hi, On Thu, 1 Nov 2018 at 06:08, AKASHI Takahiro wrote: > > On Wed, Oct 31, 2018 at 09:54:14PM +0100, Heinrich Schuchardt wrote: > > 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 > > I found: > "Count of bytes per sector. This value may take on > only the following values: 512, 1024, 2048 or 4096." > > > assert(!(cur_pos & (bytesperclust -1))); Seems perfect ! Could you propose a patch for this ? Thanks, Clement > > It seems reasonably good. > > Thanks, > -Takahiro Akashi > > > Cf. patch > > https://lists.denx.de/pipermail/u-boot/2018-October/346178.html > > fs: fat: validate sector and cluster size. > > > > Best regards > > > > Heinrich