[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20080208231130.GA10511@elte.hu>
Date: Sat, 9 Feb 2008 00:11:31 +0100
From: Ingo Molnar <mingo@...e.hu>
To: Michael Opdenacker <michael-lists@...e-electrons.com>
Cc: Andrew Morton <akpm@...ux-foundation.org>,
Thomas Gleixner <tglx@...utronix.de>,
"H. Anvin" <hpa@...or.com>, Matt Mackall <mpm@...enic.com>,
linux-kernel@...r.kernel.org, Linux-tiny@...enic.com
Subject: Re: [PATCH] x86 (Linux Tiny): configure out support for some
processors
looks good to me, but the patch needs a serious #ifdef removal pass:
* Michael Opdenacker <michael-lists@...e-electrons.com> wrote:
> switch (c->x86_vendor) {
> +#ifdef CONFIG_CPU_SUP_AMD
> case X86_VENDOR_AMD:
> early_init_amd(c);
> break;
> +#endif
> +#ifdef CONFIG_CPU_SUP_INTEL
> case X86_VENDOR_INTEL:
> early_init_intel(c);
> break;
> +#endif
would be nice to hide these #ifdefs into include files. (define
early_init_intel()/etc. as an empty inline in an include file)
> +#ifdef CONFIG_CPU_SUP_INTEL
> intel_cpu_init();
> +#endif
> +#ifdef CONFIG_CPU_SUP_CYRIX
> cyrix_init_cpu();
> +#endif
> +#ifdef CONFIG_CPU_SUP_NSC
> nsc_init_cpu();
> +#endif
> +#ifdef CONFIG_CPU_SUP_AMD
> amd_init_cpu();
> +#endif
> +#ifdef CONFIG_CPU_SUP_CENTAUR
> centaur_init_cpu();
> +#endif
> +#ifdef CONFIG_CPU_SUP_TRANSMETA
> transmeta_init_cpu();
> +#endif
> +#ifdef CONFIG_CPU_SUP_NEXGEN
> nexgen_init_cpu();
> +#endif
> +#ifdef CONFIG_CPU_SUP_UMC
> umc_init_cpu();
> +#endif
ditto - hide this into cpu.h.
> static int __cpuinit mwait_usable(const struct cpuinfo_x86 *c)
> {
> +#ifdef CONFIG_CPU_SUP_AMD
> if (force_mwait)
> return 1;
> +#endif
same - use cpu.h to define force_mwait to 0 if !CPU_SUP_AMD.
> +#ifdef CONFIG_CPU_SUP_INTEL
> static inline int page_kills_ppro(unsigned long pagenr)
> {
> if (pagenr >= 0x70000 && pagenr <= 0x7003F)
> return 1;
> return 0;
> }
> +#endif
put the #ifdef _inside_ the inline, thus:
> - if (page_is_ram(pfn) && !(bad_ppro && page_kills_ppro(pfn))) {
> + if (page_is_ram(pfn)
> +#ifdef CONFIG_CPU_SUP_INTEL
> + && !(bad_ppro && page_kills_ppro(pfn))
> +#endif
you can avoid this #ifdef. [handle bad_ppro too]
Ingo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists