mtd: rawnand: Replace zero-length arrays with DECLARE_FLEX_ARRAY() helper
Subsystems (4)
PATCH 1/1 mtd: rawnand: Replace zero-length arrays with DECLARE_FLEX_ARRAY() helper
Zero-length arrays are deprecated, and we are moving towards adopting C99 flexible-array members, instead. So, replace zero-length arrays declarations alone in structs with the new DECLARE_FLEX_ARRAY() helper macro.
This fixes warnings such as:
./drivers/mtd/nand/raw/tegra_nand.c:189:5-7: WARNING use flexible-array member instead (https://www.kernel.org/doc/html/latest/process/deprecated.html#zero-length-and-one-element-arrays)
--- drivers/mtd/nand/raw/tegra_nand.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mtd/nand/raw/tegra_nand.c +1 -1
@@ -186,7 +186,7 @@ struct tegra_nand_chip {u32 config;u32 config_ecc;u32 bch_config; -int cs[1 ]; +DECLARE_FLEX_ARRAY (int, cs); }; static inline struct tegra_nand_controller *
Signature · 6 lines
2.34.1 _______________________________________________ Linux-kernel-mentees mailing list [email protected] https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees
Quoted 4 lines · Atul Raut
Zero-length arrays are deprecated, and we are moving towards adopting C99 flexible-array members, instead. So, replace zero-length arrays declarations alone in structs with the new
DECLARE_FLEX_ARRAY()helper macro.
But again, you are not modifying a 0 length array, so why say this?
_______________________________________________
Linux-kernel-mentees mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees