Re: [PATCH -tip] x86: cpu/intel.c cleanup

From: Vegard Nossum
Date: Sat Mar 14 2009 - 10:00:39 EST


2009/3/14 Jaswinder Singh Rajput <jaswinder@xxxxxxxxxx>:
> From: Jaswinder Singh Rajput <jaswinderrajput@xxxxxxxxx>
> Date: Sat, 14 Mar 2009 17:47:38 +0530
> Subject: [PATCH] x86: cpu/intel.c cleanup
>
> - fix various style problems
> Â- fix header files issues
>

[...]

> Âstatic void __cpuinit early_init_intel(struct cpuinfo_x86 *c)
> Â{
> + Â Â Â u64 misc_enable;
> +
> Â Â Â Â/* Unmask CPUID levels if masked: */
> Â Â Â Âif (c->x86 > 6 || (c->x86 == 6 && c->x86_model >= 0xd)) {
> - Â Â Â Â Â Â Â u64 misc_enable;
>
> Â Â Â Â Â Â Â Ârdmsrl(MSR_IA32_MISC_ENABLE, misc_enable);
>
> @@ -44,16 +45,16 @@ static void __cpuinit early_init_intel(struct cpuinfo_x86 *c)
> Â Â Â Â}
>
> Â Â Â Âif ((c->x86 == 0xf && c->x86_model >= 0x03) ||
> - Â Â Â Â Â Â Â (c->x86 == 0x6 && c->x86_model >= 0x0e))
> + Â Â Â Â Â (c->x86 == 0x6 && c->x86_model >= 0x0e))
> Â Â Â Â Â Â Â Âset_cpu_cap(c, X86_FEATURE_CONSTANT_TSC);
>
> Â#ifdef CONFIG_X86_64
> Â Â Â Âset_cpu_cap(c, X86_FEATURE_SYSENTER32);
> -#else
> +#else /* CONFIG_X86_64 */
> Â Â Â Â/* Netburst reports 64 bytes clflush size, but does IO in 128 bytes */
> Â Â Â Âif (c->x86 == 15 && c->x86_cache_alignment == 64)
> Â Â Â Â Â Â Â Âc->x86_cache_alignment = 128;
> -#endif
> +#endif /* CONFIG_X86_64 */
>
> Â Â Â Â/* CPUID workaround for 0F33/0F34 CPU */
> Â Â Â Âif (c->x86 == 0xF && c->x86_model == 0x3
> @@ -96,19 +97,18 @@ static void __cpuinit early_init_intel(struct cpuinfo_x86 *c)
> Â Â Â Â * Ingo Molnar reported a Pentium D (model 6) and a Xeon
> Â Â Â Â * (model 2) with the same problem.
> Â Â Â Â */
> - Â Â Â if (c->x86 == 15) {
> - Â Â Â Â Â Â Â u64 misc_enable;
> + Â Â Â if (c->x86 != 15)
> + Â Â Â Â Â Â Â return;
>
> - Â Â Â Â Â Â Â rdmsrl(MSR_IA32_MISC_ENABLE, misc_enable);
> + Â Â Â rdmsrl(MSR_IA32_MISC_ENABLE, misc_enable);
>
> - Â Â Â Â Â Â Â if (misc_enable & MSR_IA32_MISC_ENABLE_FAST_STRING) {
> - Â Â Â Â Â Â Â Â Â Â Â printk(KERN_INFO "kmemcheck: Disabling fast string operations\n");
> + Â Â Â if (misc_enable & MSR_IA32_MISC_ENABLE_FAST_STRING) {
> + Â Â Â Â Â Â Â pr_info("kmemcheck: Disabling fast string operations\n");
>
> - Â Â Â Â Â Â Â Â Â Â Â misc_enable &= ~MSR_IA32_MISC_ENABLE_FAST_STRING;
> - Â Â Â Â Â Â Â Â Â Â Â wrmsrl(MSR_IA32_MISC_ENABLE, misc_enable);
> - Â Â Â Â Â Â Â }
> + Â Â Â Â Â Â Â misc_enable &= ~MSR_IA32_MISC_ENABLE_FAST_STRING;
> + Â Â Â Â Â Â Â wrmsrl(MSR_IA32_MISC_ENABLE, misc_enable);
> Â Â Â Â}
> -#endif
> +#endif /* CONFIG_KMEMCHECK */
> Â}

I don't really like this change (last hunk). Doesn't it seem a bit
pointless? It breaks the symmetry with the masked CPUID levels at the
beginning of the function. If somebody wants to add something else to
this function, it might have to be reindented again. Or is there a
problem with too long lines here?

But it's just a question of taste -- if this is the preferred style,
then it's fine.


Vegard
--
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/