[PATCH] mtd: maps: physmap-core: fix flash size larger than 32-bit

Miquel Raynal miquel.raynal at bootlin.com
Mon Feb 26 02:43:34 PST 2024


On Thu, 2024-02-08 at 10:34:18 UTC, Baruch Siach wrote:
> mtd-ram can potentially be larger than 4GB. get_bitmask_order() uses
> fls() that is not guaranteed to work with values larger than 32-bit.
> Specifically on aarch64 fls() returns 0 when all 32 LSB bits are clear.
> Use fls64() instead.
> 
> Fixes: ba32ce95cbd987 ("mtd: maps: Merge gpio-addr-flash.c into physmap-core.c")
> Signed-off-by: Baruch Siach <baruch at tkos.co.il>

Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git mtd/next, thanks.

Miquel



More information about the linux-mtd mailing list