]> git.ipfire.org Git - thirdparty/u-boot.git/commit
mtd: rawnand: sunxi_spl: Fix cast to pointer from integer warnings
authorRichard Genoud <richard.genoud@bootlin.com>
Fri, 23 Jan 2026 11:44:59 +0000 (12:44 +0100)
committerMichael Trimarchi <michael@amarulasolutions.com>
Tue, 3 Feb 2026 20:45:21 +0000 (21:45 +0100)
commite41e5ae4b5e7fa8d9d08c5cdfba793632321dbf6
tree3e2260bdff5fe4743aba27017ff92638d3296b80
parent7d1de98011519ebbb128f76f368724b62f3bc6eb
mtd: rawnand: sunxi_spl: Fix cast to pointer from integer warnings

Fix a cast to pointer from integer warning on ARM64

On 64bits platform, the casts done in {read,write}l() give that kind of
warnings:
drivers/mtd/nand/raw/sunxi_nand_spl.c: In function ‘check_value_inner’:
./arch/arm/include/asm/io.h:110:43: warning: cast to pointer from \
integer of different size [-Wint-to-pointer-cast]
  110 | #define __raw_readl(a) (*(volatile unsigned int *)(a))
      |                          ^
[...]
drivers/mtd/nand/raw/sunxi_nand_spl.c:81:27: note: in expansion of \
macro ‘readl’
   81 |                 int val = readl(offset) & expected_bits;

Introduce {read,write}l_nfc inline function to do the right cast and
push the base address (SUNXI_NFC_BASE) into those functions, making the
code more readable.

Signed-off-by: Richard Genoud <richard.genoud@bootlin.com>
Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
drivers/mtd/nand/raw/sunxi_nand_spl.c