Skip to contentSkip to conversation

mtd: cmdlinepart: use a flexible array member

PATCH Applied Rosen Penev 2 participants 2 messages Mar 17 – Mar 18 Memory technology devices (MTD)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mtd: cmdlinepart: use a flexible array member

This is already allocated properly. It's just using an extra pointer.

---
 drivers/mtd/parsers/cmdlinepart.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/mtd/parsers/cmdlinepart.c +1 -2
index 60ab61493ffd..e79edf9931de 100644
@@ -50,9 +50,9 @@
 
 struct cmdline_mtd_partition {
 	struct cmdline_mtd_partition *next;
-	char *mtd_id;
 	int num_parts;
 	struct mtd_partition *parts;
+	char mtd_id[];
 };
 
 /* mtdpart_setup() parses into here */
@@ -289,7 +289,6 @@ static int mtdpart_setup_real(char *s)
 		/* enter results */
 		this_mtd->parts = parts;
 		this_mtd->num_parts = num_parts;
-		this_mtd->mtd_id = (char*)(this_mtd + 1);
 		strscpy(this_mtd->mtd_id, mtd_id, mtd_id_len + 1);
 
 		/* link into chain */
Signature · 1 line
2.53.0
maintainer Applied
#1 lore raw
Quoted 3 lines · Rosen Penev

This is already allocated properly. It's just using an extra pointer.

Applied to mtd/next, thanks!

[1/1] mtd: cmdlinepart: use a flexible array member

      commit: b800359a4dfacae983cd01f8c3f1cbb6f4c9f816

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