Skip to contentSkip to conversation

mtd: rawnand: replace one-element array with flexible-array member

PATCH In review Atul Raut 2 participants 2 messages Aug 6, 2023 – Aug 7, 2023

Subsystems (4)
lore
Share & tools
lore

Atul Raut

author
#0 lore raw

PATCH v2 1/1 mtd: rawnand: replace one-element array with flexible-array member

One-element arrays are obsolete, and flexible array members have taken their place. So, in struct tegra_nand_chip, replace the one-element array with a flexible-array member.

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)

---
v1 -> v2:
Corrected commit message

---
 drivers/mtd/nand/raw/tegra_nand.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mtd/nand/raw/tegra_nand.c +1 -1
index eb0b9d16e8da..f34cd8cd0eaf 100644
@@ -186,7 +186,7 @@ struct tegra_nand_chip {
 	u32 config;
 	u32 config_ecc;
 	u32 bch_config;
-	int cs[1];
+	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
#1 lore raw
Quoted 21 lines · Atul Raut

One-element arrays are obsolete, and flexible array members have taken their place. So, in struct tegra_nand_chip, replace the one-element array with a flexible-array member.

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)

---
v1 -> v2:
Corrected commit message

---
 drivers/mtd/nand/raw/tegra_nand.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mtd/nand/raw/tegra_nand.c +0 -0
index eb0b9d16e8da..f34cd8cd0eaf 100644

drivers/mtd/nand/raw/tegra_nand.c struct tegra_nand_chip { · line 190

Quoted 6 lines
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];
+	int cs[];
 };

Again, no, please stop. We have responded as to why these changes are not correct, why are you ignoring our reviews?

greg k-h
_______________________________________________
Linux-kernel-mentees mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees