Skip to contentSkip to conversation

board: stm32mp1: use const for struct node_info

PATCH New Patrick Delaunay 2 participants 3 messages Jul 29, 2020 – Aug 13, 2020 Arm STM32

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 board: stm32mp1: use const for struct node_info

Use const for the variable nodes in ft_board_setup,
this patch follow fdt_fixup_mtdparts prototype and no more use stack.

---

 board/st/stm32mp1/stm32mp1.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
board/st/stm32mp1/stm32mp1.c +1 -1
index 1d274c3157..68c4a221da 100644
@@ -847,7 +847,7 @@ int mmc_get_env_dev(void)
 int ft_board_setup(void *blob, struct bd_info *bd)
 {
 #ifdef CONFIG_FDT_FIXUP_PARTITIONS
-	struct node_info nodes[] = {
+	static const struct node_info nodes[] = {
 		{ "st,stm32f469-qspi",		MTD_DEV_TYPE_NOR,  },
 		{ "st,stm32f469-qspi",		MTD_DEV_TYPE_SPINAND},
 		{ "st,stm32mp15-fmc2",		MTD_DEV_TYPE_NAND, },
Signature · 1 line
2.17.1
#1 lore raw

PATCH 1/1 board: stm32mp1: use const for struct node_info

Hi Patrick

Quoted 14 lines · Patrick Delaunay

Use const for the variable nodes in ft_board_setup,
this patch follow fdt_fixup_mtdparts prototype and no more use stack.

---

 board/st/stm32mp1/stm32mp1.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
board/st/stm32mp1/stm32mp1.c +0 -0
index 1d274c3157..68c4a221da 100644

board/st/stm32mp1/stm32mp1.c int mmc_get_env_dev(void) · line 853

Quoted 8 lines
board/st/stm32mp1/stm32mp1.c +1 -1
@@ -847,7 +847,7 @@ int mmc_get_env_dev(void)
 int ft_board_setup(void *blob, struct bd_info *bd)
 {
 #ifdef CONFIG_FDT_FIXUP_PARTITIONS
-	struct node_info nodes[] = {
+	static const struct node_info nodes[] = {
 		{ "st,stm32f469-qspi",		MTD_DEV_TYPE_NOR,  },
 		{ "st,stm32f469-qspi",		MTD_DEV_TYPE_SPINAND},
 		{ "st,stm32mp15-fmc2",		MTD_DEV_TYPE_NAND, },

Thanks

Patrice

#2 lore raw

PATCH 1/1 board: stm32mp1: use const for struct node_info

Quoted 11 lines · Patrice CHOTARD

Hi Patrick

Quoted 8 lines · Patrick Delaunay

Use const for the variable nodes in ft_board_setup,
this patch follow fdt_fixup_mtdparts prototype and no more use stack.

---

 board/st/stm32mp1/stm32mp1.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Applied on u-boot-stm/master

Thanks

Quoted 23 lines
Quoted 6 lines
board/st/stm32mp1/stm32mp1.c +0 -0
index 1d274c3157..68c4a221da 100644

board/st/stm32mp1/stm32mp1.c int mmc_get_env_dev(void) · line 853

Quoted 8 lines
board/st/stm32mp1/stm32mp1.c +1 -1
@@ -847,7 +847,7 @@ int mmc_get_env_dev(void)
 int ft_board_setup(void *blob, struct bd_info *bd)
 {
 #ifdef CONFIG_FDT_FIXUP_PARTITIONS
-	struct node_info nodes[] = {
+	static const struct node_info nodes[] = {
 		{ "st,stm32f469-qspi",		MTD_DEV_TYPE_NOR,  },
 		{ "st,stm32f469-qspi",		MTD_DEV_TYPE_SPINAND},
 		{ "st,stm32mp15-fmc2",		MTD_DEV_TYPE_NAND, },

Thanks

Patrice
_______________________________________________
Uboot-stm32 mailing list
Uboot-stm32 at st-md-mailman.stormreply.com
https://st-md-mailman.stormreply.com/mailman/listinfo/uboot-stm32