Skip to contentSkip to conversation

block: partitions: only define function mac_fix_string for CONFIG_PPC_PMAC

PATCH Applied Colin Ian King 2 participants 2 messages Mar 8, 2024 – Mar 13, 2024

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

PATCH 1/1 block: partitions: only define function mac_fix_string for CONFIG_PPC_PMAC

The helper function mac_fix_string is only required with CONFIG_PPC_PMAC, add #if CONFIG_PPC_PMAC and #endif around the function.

Cleans up clang scan build warning:
block/partitions/mac.c:23:20: warning: unused function 'mac_fix_string' [-Wunused-function]

---
 block/partitions/mac.c | 2 ++
 1 file changed, 2 insertions(+)
block/partitions/mac.c +2 -0
index 7b521df00a39..c80183156d68 100644
@@ -20,6 +20,7 @@ extern void note_bootable_part(dev_t dev, int part, int goodness);
  * Code to understand MacOS partition tables.
  */
 
+#ifdef CONFIG_PPC_PMAC
 static inline void mac_fix_string(char *stg, int len)
 {
 	int i;
@@ -27,6 +28,7 @@ static inline void mac_fix_string(char *stg, int len)
 	for (i = len - 1; i >= 0 && stg[i] == ' '; i--)
 		stg[i] = 0;
 }
+#endif
 
 int mac_partition(struct parsed_partitions *state)
 {
Signature · 1 line
2.39.2
maintainer Applied
#1 lore raw
Quoted 8 lines · Colin Ian King

The helper function mac_fix_string is only required with CONFIG_PPC_PMAC, add #if CONFIG_PPC_PMAC and #endif around the function.

Cleans up clang scan build warning:
block/partitions/mac.c:23:20: warning: unused function 'mac_fix_string' [-Wunused-function]

[...]

Applied, thanks!

[1/1] block: partitions: only define function mac_fix_string for CONFIG_PPC_PMAC

      commit: 5205a4aa8fc9454853b705b69611c80e9c644283

Best regards,

Signature · 1 line
Jens Axboe