[PATCH] fs: ramfs: simplify len calculation in ramfs_find_chunk

Sascha Hauer s.hauer at pengutronix.de
Tue Jul 30 01:17:11 PDT 2024


On Wed, 24 Jul 2024 11:09:32 +0200, Ahmad Fatoum wrote:
> ramfs_find_chunk finds the correct chunk and additionally returns via
> argument pointers the offset to use and the remaining length.
> 
> While correct, the way the remaining len is calculated can be simplified
> by using the offset previously calculated:
> 
>   data->ofs  +        data->size - pos
>   data->size -  pos + data->ofs
>   data->size - (pos - data->ofs)
>   data->size - (*ofs)
> 
> [...]

Applied, thanks!

[1/1] fs: ramfs: simplify len calculation in ramfs_find_chunk
      https://git.pengutronix.de/cgit/barebox/commit/?id=e2f6209720d8 (link may not be stable)

Best regards,
-- 
Sascha Hauer <s.hauer at pengutronix.de>




More information about the barebox mailing list