Re: [tip:x86/urgent] x86/platform: Remove incorrect error message inx86_default_fixup_cpu_id()

From: Ingo Molnar
Date: Fri Mar 02 2012 - 06:04:54 EST



* tip-bot for Andreas Herrmann <andreas.herrmann3@xxxxxxx> wrote:

> +++ b/arch/x86/kernel/cpu/common.c
> diff --git a/arch/x86/kernel/x86_init.c b/arch/x86/kernel/x86_init.c
> index 947a06c..67cf78a 100644
> --- a/arch/x86/kernel/x86_init.c
> +++ b/arch/x86/kernel/x86_init.c
> @@ -90,6 +90,7 @@ struct x86_init_ops x86_init __initdata = {
> },
> };
>
> +void __cpuinit x86_default_fixup_cpu_id(struct cpuinfo_x86 *c, int n) { }
> struct x86_cpuinit_ops x86_cpuinit __cpuinitdata = {

Hm, I missed this first time around:

- why is this function global? It's not used by anything else.

- why is it squeezed before a structure without any vertical
separation?

- why does it have the body as { }, as if it were an inline
function?

Really, this should either be a short static function, with a
proper body, or we should accept a NULL pointer there and check
for it before calling it - there's a single usage site right
now.

The latter looks like the cleanest solution to me.

Thanks,

Ingo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/