mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@elte.hu>
To: Michael Opdenacker <michael-lists@free-electrons.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Thomas Gleixner <tglx@linutronix.de>, "H. Anvin" <hpa@zytor.com>,
	Matt Mackall <mpm@selenic.com>,
	linux-kernel@vger.kernel.org, Linux-tiny@selenic.com
Subject: Re: [PATCH] x86 (Linux Tiny): configure out support for some processors
Date: Sat, 9 Feb 2008 00:11:31 +0100	[thread overview]
Message-ID: <20080208231130.GA10511@elte.hu> (raw)
In-Reply-To: <200802082347.25364.michael-lists@free-electrons.com>


looks good to me, but the patch needs a serious #ifdef removal pass:

* Michael Opdenacker <michael-lists@free-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

  parent reply	other threads:[~2008-02-08 23:12 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-08 22:47 Michael Opdenacker
2008-02-08 23:04 ` H. Peter Anvin
2008-02-08 23:11 ` Ingo Molnar [this message]
2008-02-09  9:31   ` Michael Opdenacker
2008-02-11 22:42   ` Michael Opdenacker
2008-02-11 22:56     ` Matt Mackall
2008-02-11 23:01       ` H. Peter Anvin
2008-02-11 23:28         ` Matt Mackall
2008-02-12  0:54           ` H. Peter Anvin
2008-02-12  1:15             ` Matt Mackall
2008-02-15 11:00             ` [RFC] [PATCH] x86: Use ELF section to list CPU vendor specific code (Linux Tiny) Thomas Petazzoni
2008-02-17 18:14               ` Ingo Molnar
2008-02-17 19:46                 ` H. Peter Anvin
2008-02-23  2:43               ` Matt Mackall
2008-02-23  3:19                 ` H. Peter Anvin
2008-02-25  8:29                 ` Thomas Petazzoni
2008-02-25 17:03                   ` Matt Mackall
2008-02-25 17:53                     ` Thomas Petazzoni
2008-02-25 17:58                       ` Matt Mackall
2008-02-11 22:59     ` [PATCH] x86 (Linux Tiny): configure out support for some processors H. Peter Anvin
2008-02-08 23:20 ` Matt Mackall
2008-02-09  8:30   ` Simon Holm Thøgersen
2008-02-09  9:29     ` Michael Opdenacker
2008-02-09 10:05       ` Simon Holm Thøgersen
2008-02-09 21:35       ` H. Peter Anvin
2008-02-09  9:26   ` Michael Opdenacker
2008-02-09  3:48 ` Taral

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080208231130.GA10511@elte.hu \
    --to=mingo@elte.hu \
    --cc=Linux-tiny@selenic.com \
    --cc=akpm@linux-foundation.org \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michael-lists@free-electrons.com \
    --cc=mpm@selenic.com \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®