Skip to contentSkip to conversation

SPL: stm32mp1: fix spl_mmc_boot_partition not defined

PATCH New Richard Genoud 2 participants 5 messages Oct 12, 2020 – Nov 25, 2020

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 SPL: stm32mp1: fix spl_mmc_boot_partition not defined

spl_mmc_boot_partition is only defined when CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION is defined.

---
 arch/arm/mach-stm32mp/spl.c | 2 ++
 1 file changed, 2 insertions(+)
arch/arm/mach-stm32mp/spl.c +2 -0
index e84bdad7bfc..32a4a69282a 100644
@@ -55,6 +55,7 @@ u32 spl_mmc_boot_mode(const u32 boot_device)
 	return MMCSD_MODE_RAW;
 }
 
+#ifdef CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION
 int spl_mmc_boot_partition(const u32 boot_device)
 {
 	switch (boot_device) {
@@ -66,6 +67,7 @@ int spl_mmc_boot_partition(const u32 boot_device)
 		return -EINVAL;
 	}
 }
+#endif
 
 #ifdef CONFIG_SPL_DISPLAY_PRINT
 void spl_display_print(void)
#1 lore raw

PATCH 1/1 SPL: stm32mp1: fix spl_mmc_boot_partition not defined

Hi Richard,

Quoted 11 lines

From: Richard Genoud <[email protected]>
Sent: lundi 12 octobre 2020 16:11

spl_mmc_boot_partition is only defined when CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION is defined.

---
 arch/arm/mach-stm32mp/spl.c | 2 ++
 1 file changed, 2 insertions(+)

Thanks for this missing check in spl.

NB: after check, it is possible to IS_ENABLED to prevent #ifdef here

<unknown>:0: warning: Use 'if (IS_ENABLED(CONFIG...))' instead of '#if or #ifdef' where possible

Patrick

#2 lore raw

PATCH 1/1 SPL: stm32mp1: fix spl_mmc_boot_partition not defined

Hi Patrick,

Le 13/10/2020 ? 14:18, Patrick DELAUNAY a ?crit?:

Quoted 14 lines

Hi Richard,

Quoted 11 lines

From: Richard Genoud <[email protected]>
Sent: lundi 12 octobre 2020 16:11

spl_mmc_boot_partition is only defined when CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION is defined.

---
  arch/arm/mach-stm32mp/spl.c | 2 ++
  1 file changed, 2 insertions(+)
Quoted 7 lines

Thanks for this missing check in spl.

NB: after check, it is possible to IS_ENABLED to prevent #ifdef here

<unknown>:0: warning: Use 'if (IS_ENABLED(CONFIG...))' instead of '#if or #ifdef' where possible

I don't think it's possible to use "if (IS_ENABLED(CONFIG...))" since we have to remove the whole function, not just some code in it.

Regards,
Richard

#3 lore raw

PATCH 1/1 SPL: stm32mp1: fix spl_mmc_boot_partition not defined

Hi,

Quoted 24 lines

From: Richard Genoud <[email protected]>
Sent: mardi 13 octobre 2020 14:25

Hi Patrick,

Le 13/10/2020 ? 14:18, Patrick DELAUNAY a ?crit?:

Quoted 18 lines

Hi Richard,

Quoted 11 lines

From: Richard Genoud <[email protected]>
Sent: lundi 12 octobre 2020 16:11

spl_mmc_boot_partition is only defined when CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION is defined.

---
  arch/arm/mach-stm32mp/spl.c | 2 ++
  1 file changed, 2 insertions(+)

Thanks for this missing check in spl.

Quoted 7 lines
Quoted 4 lines

NB: after check, it is possible to IS_ENABLED to prevent #ifdef here

<unknown>:0: warning: Use 'if (IS_ENABLED(CONFIG...))' instead of '#if or #ifdef' where possible

I don't think it's possible to use "if (IS_ENABLED(CONFIG...))" since we have to remove the whole function, not just some code in it.

Normally the unused function is remove by linker without compilation flag...

But after check on my side it is not possible to use IS_ENABLED(CONFIG_ here... because when the flags is absent, the 2 used CONFIG_ are also absent:
- CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_PARTITION
- CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_PARTITION_MMC2

And that cause compilation issue

Sorry for first feedback, I will take the patch in my next pull request.

Quoted 2 lines

Regards,
Richard

Regards
Patrick

#4 lore raw

PATCH 1/1 SPL: stm32mp1: fix spl_mmc_boot_partition not defined

In reply to Richard Genoud

Hi Richard,

Quoted 11 lines

From: Richard Genoud <[email protected]>
Sent: lundi 12 octobre 2020 16:11

spl_mmc_boot_partition is only defined when CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION is defined.

---
 arch/arm/mach-stm32mp/spl.c | 2 ++
 1 file changed, 2 insertions(+)

Applied to u-boot-stm/master, thanks!

Regards

Patrick