Skip to contentSkip to conversation

xtensa: annotate dtb_start variable as static __initdata

PATCH In review Masahiro Yamada 2 participants 3 messages Sep 18, 2024 – Nov 7, 2024 Tensilica Xtensa port (xtensa)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xtensa: annotate dtb_start variable as static __initdata

The 'dtb_start' variable is only used within arch/xtensa/kernel/setup.c. Mark it as 'static'.

It is only used by parse_tag_fdt() and init_arch(), both of which are annotated as __init. Therefore, dtb_start can be annotated as __initdata, so it will discarded after boot.

---

 arch/xtensa/kernel/setup.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/xtensa/kernel/setup.c +1 -1
index bdec4a773af0..3e076b64cc61 100644
@@ -55,7 +55,7 @@ extern int initrd_below_start_ok;
 #endif
 
 #ifdef CONFIG_USE_OF
-void *dtb_start = __dtb_start;
+static void *dtb_start __initdata = __dtb_start;
 #endif
 
 extern unsigned long loops_per_jiffy;
Signature · 1 line
2.43.0
#1 lore raw
Quoted 10 lines · Masahiro Yamada

The 'dtb_start' variable is only used within arch/xtensa/kernel/setup.c. Mark it as 'static'.

It is only used by parse_tag_fdt() and init_arch(), both of which are annotated as __init. Therefore, dtb_start can be annotated as __initdata, so it will discarded after boot.

---

Ping?

Quoted 20 lines
 arch/xtensa/kernel/setup.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/xtensa/kernel/setup.c +1 -2
index bdec4a773af0..3e076b64cc61 100644
@@ -55,7 +55,7 @@ extern int initrd_below_start_ok;
 #endif
 
 #ifdef CONFIG_USE_OF
-void *dtb_start = __dtb_start;
+static void *dtb_start __initdata = __dtb_start;
 #endif
 
 extern unsigned long loops_per_jiffy;
--

2.43.0

Signature · 2 lines
Best Regards
Masahiro Yamada
maintainer
#2 lore raw
Quoted 6 lines · Masahiro Yamada
Quoted 4 lines · Masahiro Yamada

The 'dtb_start' variable is only used within arch/xtensa/kernel/setup.c. Mark it as 'static'.

Quoted 8 lines
Quoted 6 lines

It is only used by parse_tag_fdt() and init_arch(), both of which are annotated as __init. Therefore, dtb_start can be annotated as __initdata, so it will discarded after boot.

---

Ping?

Thanks. Applied to my xtensa tree.

-- Max