mtd: rawnand: ndfc: add CONFIG_OF dependency
Subsystems (2)
PATCH 1/1 mtd: rawnand: ndfc: add CONFIG_OF dependency
From: Arnd Bergmann <[email protected]>
When compile-testing on x86 without CONFIG_OF, the ndfc driver produces a harmless warning:
drivers/mtd/nand/raw/ndfc.c: In function 'ndfc_probe':include/linux/dev_printk.h:154:31: error: 'len' is used uninitialized [-Werror=uninitialized]
154 | dev_printk_index_wrap(_dev_err, KERN_ERR, dev, dev_fmt(fmt), ##__VA_ARGS__)
| ^drivers/mtd/nand/raw/ndfc.c:196:17: note: in expansion of macro 'dev_err'
196 | dev_err(&ofdev->dev, "unable read reg property (%d)\n", len);
Limit compile-testing to configurations with CONFIG_OF to trivially avoid this. The driver will still be built in allmodconfig and many randconfig builds.
---
We may also want to change the of_get_property() stub function to initialize *len.
--- drivers/mtd/nand/raw/Kconfig | 1 + 1 file changed, 1 insertion(+)
drivers/mtd/nand/raw/Kconfig +1 -0
@@ -72,6 +72,7 @@ config MTD_NAND_AU1550 config MTD_NAND_NDFC tristate "IBM/MCC 4xx NAND controller" depends on 44x || COMPILE_TEST + depends on OF select MTD_NAND_ECC_SW_HAMMING select MTD_NAND_ECC_SW_HAMMING_SMC help
Signature · 1 line
2.39.5
Quoted 13 lines · Arnd Bergmann
From: Arnd Bergmann <[email protected]>
When compile-testing on x86 without
CONFIG_OF, the ndfc driver produces a harmless warning:
drivers/mtd/nand/raw/ndfc.c: In function 'ndfc_probe':include/linux/dev_printk.h:154:31: error: 'len' is used uninitialized [-Werror=uninitialized]
154 |dev_printk_index_wrap(_dev_err, KERN_ERR, dev, dev_fmt(fmt), ##__VA_ARGS__)
| ^drivers/mtd/nand/raw/ndfc.c:196:17: note: in expansion of macro 'dev_err'
196 |dev_err(&ofdev->dev, "unable read reg property (%d)\n", len);
Quoted 5 lines
Limit compile-testing to configurations with
CONFIG_OFto trivially avoid this. The driver will still be built in allmodconfig and many randconfig builds.Fixes 4f2692a5383e ("mtd: rawnand: ndfc: use ioread32be/iowrite32be and allow COMPILE_TEST")
Might also want to add
If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
Quoted 1 line
Signed-off-by Arnd Bergmann <[email protected]>
Quoted 22 lines
---
We may also want to change theof_get_property()stub function to initialize *len.--- drivers/mtd/nand/raw/Kconfig | 1 + 1 file changed, 1 insertion(+)drivers/mtd/nand/raw/Kconfig +1
-1@@ -72,6 +72,7 @@ config MTD_NAND_AU1550 config MTD_NAND_NDFC tristate "IBM/MCC 4xx NAND controller" depends on 44x || COMPILE_TEST + depends on OF select MTD_NAND_ECC_SW_HAMMING select MTD_NAND_ECC_SW_HAMMING_SMC help --2.39.5
Quoted 11 lines · Arnd Bergmann
When compile-testing on x86 without
CONFIG_OF, the ndfc driver produces a harmless warning:
drivers/mtd/nand/raw/ndfc.c: In function 'ndfc_probe':include/linux/dev_printk.h:154:31: error: 'len' is used uninitialized [-Werror=uninitialized]
154 |dev_printk_index_wrap(_dev_err, KERN_ERR, dev, dev_fmt(fmt), ##__VA_ARGS__)
| ^drivers/mtd/nand/raw/ndfc.c:196:17: note: in expansion of macro 'dev_err'
196 |dev_err(&ofdev->dev, "unable read reg property (%d)\n", len);[...]
Applied to mtd/fixes, thanks!
[1/1] mtd: rawnand: ndfc: add CONFIG_OF dependency
commit: 97f9e509d839f7e5b9a32105ae322e5223c86786
Patche(s) should be available on mtd/linux.git and will be part of the next PR (provided that no robot complains by then).
Kind regards,
Miquèl