Skip to contentSkip to conversation

x86: hide unused allocate_percpu_fixmap_ptes

PATCH In review Arnd Bergmann 2 participants 2 messages Dec 18, 2017 – Dec 30, 2017 x86

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86: hide unused allocate_percpu_fixmap_ptes

The new function is not always used, causing a warning whenever CONFIG_CPU_SUP_INTEL is disabled:

arch/x86/kernel/cpu/common.c:522:20: error: 'allocate_percpu_fixmap_ptes' defined but not used [-Werror=unused-function]

Hide it in the same #ifdef.

Fixes 3015f86f838c ("x86/fixmap: Add debugstore entries to cpu_entry_area")
---
 arch/x86/kernel/cpu/common.c | 2 ++
 1 file changed, 2 insertions(+)
arch/x86/kernel/cpu/common.c +2 -0
index 6444f91e8d3c..6f354416a67f 100644
@@ -519,11 +519,13 @@ static DEFINE_PER_CPU_PAGE_ALIGNED(struct entry_stack_page,
  * Force the population of PMDs for not yet allocated per cpu
  * memory like debug store buffers.
  */
+#ifdef CONFIG_CPU_SUP_INTEL
 static void __init allocate_percpu_fixmap_ptes(int idx, int pages)
 {
 	for (; pages; pages--, idx--)
 		__set_fixmap(idx, 0, PAGE_NONE);
 }
+#endif
 
 static void __init
 set_percpu_fixmap_pages(int idx, void *ptr, int pages, pgprot_t prot)
Signature · 1 line
2.9.0
#1 lore raw
Quoted 18 lines · Arnd Bergmann

The new function is not always used, causing a warning whenever CONFIG_CPU_SUP_INTEL is disabled:

arch/x86/kernel/cpu/common.c:522:20: error: 'allocate_percpu_fixmap_ptes' defined but not used [-Werror=unused-function]

Hide it in the same #ifdef.

Fixes 3015f86f838c ("x86/fixmap: Add debugstore entries to cpu_entry_area")
---
 arch/x86/kernel/cpu/common.c | 2 ++
 1 file changed, 2 insertions(+)
arch/x86/kernel/cpu/common.c +0 -0
index 6444f91e8d3c..6f354416a67f 100644

arch/x86/kernel/cpu/common.c static DEFINE_PER_CPU_PAGE_ALIGNED(struct entry_stack_page, · line 528

Quoted 10 lines
arch/x86/kernel/cpu/common.c +2 -0
@@ -519,11 +519,13 @@ static DEFINE_PER_CPU_PAGE_ALIGNED(struct entry_stack_page,
  * Force the population of PMDs for not yet allocated per cpu
  * memory like debug store buffers.
  */
+#ifdef CONFIG_CPU_SUP_INTEL
 static void __init allocate_percpu_fixmap_ptes(int idx, int pages)
 {
 	for (; pages; pages--, idx--)
 		__set_fixmap(idx, 0, PAGE_NONE);
 }
+#endif

Ok, this fix should be moot as the allocate_percpu_fixmap_ptes() is gone from the latest versions of PTI.

Thanks,

Ingo