[PATCH] fs/erofs: Fix build for m68k
Daniel Palmer
daniel at thingy.jp
Mon Apr 27 11:40:24 CEST 2026
Hi Kuan-Wei,
On Sun, 26 Apr 2026 at 01:12, Kuan-Wei Chiu <visitorckw at gmail.com> wrote:
> Since round_up(x, y) requires y to be a power of two, I was wondering
> if it might be worth adding an assertion here to ensure this?
I think if we need that we should maybe wire it into round_up() so it
checks everything using it is passing a power of two.
I thought maybe the linux version had some compile time assert thing
but it doesn't seem to check either.
> Additionally, a bit further down in erofs_map_blocks(), there is
> another instance where roundup() is used. I haven't checked the
> generated assembly, but I'm guessing it didn't fail because gcc was
> smart enough to optimize it into a right shift? Since erofs_blksiz() is
> defined as (1u << sbi.blkszbits), it is also guaranteed to be a power
> of two. Perhaps we should replace that one with round_up() as well, for
> safety and consistency?
mmm maybe I should grep for all of the instances of roundup() in the
erofs code and fix them all at once.
Thanks,
Daniel
More information about the U-Boot
mailing list