Skip to contentSkip to conversation

pref/x86/rapl: Remove unused function

PATCH In review Andy Shevchenko 2 participants 3 messages Dec 2, 2024 – Dec 5, 2024

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

PATCH 1/1 pref/x86/rapl: Remove unused function

get_rapl_pmu_cpumask() is unused, it prevents kernel builds with clang, make W=1 and CONFIG_WERROR=y:

arch/x86/events/rapl.c:165:37: error: unused function 'get_rapl_pmu_cpumask' [-Werror,-Wunused-function]

Fix this by removing unused function.

See also commit 6863f5643dd7 ("kbuild: allow Clang to find unused static inline functions for W=1 build").

Fixes 9e9af8bbb5f9 ("perf/x86/rapl: Clean up cpumask and hotplug")
---
 arch/x86/events/rapl.c | 6 ------
 1 file changed, 6 deletions(-)
arch/x86/events/rapl.c +0 -6
index a8defc813c36..3ed5ea2aa867 100644
@@ -162,12 +162,6 @@ static inline unsigned int get_rapl_pmu_idx(int cpu)
 					 topology_logical_die_id(cpu);
 }
 
-static inline const struct cpumask *get_rapl_pmu_cpumask(int cpu)
-{
-	return rapl_pmu_is_pkg_scope() ? topology_core_cpumask(cpu) :
-					 topology_die_cpumask(cpu);
-}
-
 static inline struct rapl_pmu *cpu_to_rapl_pmu(unsigned int cpu)
 {
 	unsigned int rapl_pmu_idx = get_rapl_pmu_idx(cpu);
Signature · 1 line
2.43.0.rc1.1336.g36b5255a03ac
reviewer Reviewed-by on v1 1/1
#1 lore raw
Quoted 6 lines · Andy Shevchenko

get_rapl_pmu_cpumask() is unused, it prevents kernel builds with clang, make W=1 and CONFIG_WERROR=y:

arch/x86/events/rapl.c:165:37: error: unused function 'get_rapl_pmu_cpumask' [-Werror,-Wunused-function]

Quoted 7 lines

Fix this by removing unused function.

See also commit 6863f5643dd7 ("kbuild: allow Clang to find unused static inline functions for W=1 build").

Fixes 9e9af8bbb5f9 ("perf/x86/rapl: Clean up cpumask and hotplug")

nit: s/pref/perf/ in the commit message title

Thanks,
Ian

Quoted 24 lines
---
 arch/x86/events/rapl.c | 6 ------
 1 file changed, 6 deletions(-)
arch/x86/events/rapl.c +0 -7
index a8defc813c36..3ed5ea2aa867 100644
@@ -162,12 +162,6 @@ static inline unsigned int get_rapl_pmu_idx(int cpu)
                                         topology_logical_die_id(cpu);
 }
 
-static inline const struct cpumask *get_rapl_pmu_cpumask(int cpu)
-{
-       return rapl_pmu_is_pkg_scope() ? topology_core_cpumask(cpu) :
-                                        topology_die_cpumask(cpu);
-}
-
 static inline struct rapl_pmu *cpu_to_rapl_pmu(unsigned int cpu)
 {
        unsigned int rapl_pmu_idx = get_rapl_pmu_idx(cpu);
--

2.43.0.rc1.1336.g36b5255a03ac

#2 lore raw
Quoted 13 lines · Ian Rogers
Quoted 11 lines · Andy Shevchenko

get_rapl_pmu_cpumask() is unused, it prevents kernel builds with clang, make W=1 and CONFIG_WERROR=y:

arch/x86/events/rapl.c:165:37: error: unused function 'get_rapl_pmu_cpumask' [-Werror,-Wunused-function]

Fix this by removing unused function.

See also commit 6863f5643dd7 ("kbuild: allow Clang to find unused static inline functions for W=1 build").

Quoted 6 lines
Quoted 2 lines
Fixes 9e9af8bbb5f9 ("perf/x86/rapl: Clean up cpumask and hotplug")

nit: s/pref/perf/ in the commit message title

Thanks, the analogue change is already in the perf tree. Just hadn't made the rc1.

Signature · 2 lines
With Best Regards,
Andy Shevchenko