Skip to contentSkip to conversation

x86/cpu: remove needless definition for !CONFIG_X86_32

PATCH In review Lukas Bulwahn 2 participants 2 messages Nov 16, 2020

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

PATCH 1/1 x86/cpu: remove needless definition for !CONFIG_X86_32

The function flag_is_changeable_p() is used in:

- have_cpuid_p() for its CONFIG_X86_32 definition
- identify_cpu_without_cpuid() within its CONFIG_X86_32 ifdef-block

So, there is no need to define flag_is_changeable_p() if !CONFIG_X86_32. Simply remove this needless definition.

This was discovered with make CC=clang W=1:

arch/x86/kernel/cpu/common.c:283:19:
warning: unused function 'flag_is_changeable_p' [-Wunused-function]

---
applies cleanly on current master and next-20201116

Thomas, Boris, please pick this minor non-urgent patch.

 arch/x86/kernel/cpu/common.c | 4 ----
 1 file changed, 4 deletions(-)
arch/x86/kernel/cpu/common.c +0 -4
index 35ad8480c464..b89dbc7ccb0c 100644
@@ -280,10 +280,6 @@ static int __init x86_serial_nr_setup(char *s)
 }
 __setup("serialnumber", x86_serial_nr_setup);
 #else
-static inline int flag_is_changeable_p(u32 flag)
-{
-	return 1;
-}
 static inline void squash_the_stupid_serial_number(struct cpuinfo_x86 *c)
 {
 }
Signature · 1 line
2.17.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 4 lines · Lukas Bulwahn

The function flag_is_changeable_p() is used in:

- have_cpuid_p() for its CONFIG_X86_32 definition
- identify_cpu_without_cpuid() within its CONFIG_X86_32 ifdef-block

This looks fine.

a bit of cleanup, identify_cpu_without_cpuid() be moved into the main CONFIG_X86_32 ifdef with stub for x86_64.

Quoted 33 lines

So, there is no need to define flag_is_changeable_p() if !CONFIG_X86_32. Simply remove this needless definition.

This was discovered with make CC=clang W=1:

arch/x86/kernel/cpu/common.c:283:19:
warning: unused function 'flag_is_changeable_p' [-Wunused-function]

---
applies cleanly on current master and next-20201116

Thomas, Boris, please pick this minor non-urgent patch.

 arch/x86/kernel/cpu/common.c | 4 ----
 1 file changed, 4 deletions(-)
arch/x86/kernel/cpu/common.c +0 -4
index 35ad8480c464..b89dbc7ccb0c 100644
@@ -280,10 +280,6 @@ static int __init x86_serial_nr_setup(char *s)
 }
 __setup("serialnumber", x86_serial_nr_setup);
 #else
-static inline int flag_is_changeable_p(u32 flag)
-{
-	return 1;
-}
 static inline void squash_the_stupid_serial_number(struct cpuinfo_x86 *c)
 {
 }