* [PATCH] x86/cpu: remove needless definition for !CONFIG_X86_32
@ 2020-11-16 9:42 Lukas Bulwahn
2020-11-16 15:27 ` Tom Rix
0 siblings, 1 reply; 2+ messages in thread
From: Lukas Bulwahn @ 2020-11-16 9:42 UTC (permalink / raw)
To: Thomas Gleixner, Ingo Molnar, Borislav Petkov, x86
Cc: H . Peter Anvin, Arnd Bergmann, Tom Rix, Nathan Chancellor,
Nick Desaulniers, clang-built-linux, kernel-janitors,
linux-kernel, 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
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]
Signed-off-by: Lukas Bulwahn <lukas.bulwahn@gmail.com>
---
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(-)
diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c
index 35ad8480c464..b89dbc7ccb0c 100644
--- a/arch/x86/kernel/cpu/common.c
+++ b/arch/x86/kernel/cpu/common.c
@@ -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)
{
}
--
2.17.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] x86/cpu: remove needless definition for !CONFIG_X86_32
2020-11-16 9:42 [PATCH] x86/cpu: remove needless definition for !CONFIG_X86_32 Lukas Bulwahn
@ 2020-11-16 15:27 ` Tom Rix
0 siblings, 0 replies; 2+ messages in thread
From: Tom Rix @ 2020-11-16 15:27 UTC (permalink / raw)
To: Lukas Bulwahn, Thomas Gleixner, Ingo Molnar, Borislav Petkov, x86
Cc: H . Peter Anvin, Arnd Bergmann, Nathan Chancellor,
Nick Desaulniers, clang-built-linux, kernel-janitors,
linux-kernel
On 11/16/20 1:42 AM, Lukas Bulwahn wrote:
> 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.
Reviewed-by: Tom Rix <trix@redhat.com>
a bit of cleanup, identify_cpu_without_cpuid() be moved into the main CONFIG_X86_32 ifdef with stub for x86_64.
>
> 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]
>
> Signed-off-by: Lukas Bulwahn <lukas.bulwahn@gmail.com>
> ---
> 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(-)
>
> diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c
> index 35ad8480c464..b89dbc7ccb0c 100644
> --- a/arch/x86/kernel/cpu/common.c
> +++ b/arch/x86/kernel/cpu/common.c
> @@ -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)
> {
> }
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-11-16 15:27 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-16 9:42 [PATCH] x86/cpu: remove needless definition for !CONFIG_X86_32 Lukas Bulwahn
2020-11-16 15:27 ` Tom Rix
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).