All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@elte.hu>
To: Jaswinder Singh Rajput <jaswinder@kernel.org>
Cc: x86 maintainers <x86@kernel.org>,
	Andreas Herrmann <andreas.herrmann3@amd.com>,
	LKML <linux-kernel@vger.kernel.org>,
	Mark Langsdorf <mark.langsdorf@amd.com>
Subject: Re: [PATCH -tip] x86: k8.h reference to node in node_to_k8_nb_misc for !CONFIG_K8_NB
Date: Tue, 14 Apr 2009 18:52:41 +0200	[thread overview]
Message-ID: <20090414165241.GB2089@elte.hu> (raw)
In-Reply-To: <1239727500.2966.16.camel@ht.satnam>


* Jaswinder Singh Rajput <jaswinder@kernel.org> wrote:

> Add reference to node in node_to_k8_nb_misc for !CONFIG_K8_NB to make compiler happy.
> 
> So fixes compiler warnings:
>   arch/x86/kernel/cpu/intel_cacheinfo.c: In function ‘show_cache_disable’:
>   arch/x86/kernel/cpu/intel_cacheinfo.c:712: warning: unused variable ‘node’
>   arch/x86/kernel/cpu/intel_cacheinfo.c: In function ‘store_cache_disable’:
>   arch/x86/kernel/cpu/intel_cacheinfo.c:739: warning: unused variable ‘node’
> 
> Signed-off-by: Jaswinder Singh Rajput <jaswinderrajput@gmail.com>
> ---
>  arch/x86/include/asm/k8.h |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/arch/x86/include/asm/k8.h b/arch/x86/include/asm/k8.h
> index c23b3d1..c81e4ee 100644
> --- a/arch/x86/include/asm/k8.h
> +++ b/arch/x86/include/asm/k8.h
> @@ -16,7 +16,7 @@ extern int k8_scan_nodes(unsigned long start, unsigned long end);
>  #define node_to_k8_nb_misc(node) \
>  	(node < num_k8_northbridges) ? k8_northbridges[node] : NULL
>  #else
> -#define node_to_k8_nb_misc(node) NULL
> +#define node_to_k8_nb_misc(node) (node) ? NULL : NULL
>  #endif

Ugh, that's very ugly. I gave you a proper solution:

>> The typical way to solve this is to add a dummy:
>> 
>> 	(void)(cpu)
>> 
>> use to the 'cpu' parameter to the macro definition - or, 
>> (which is a much better solution), to convert it to an 
>> inline function.

	Ingo

  reply	other threads:[~2009-04-14 16:53 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-14 16:45 [PATCH -tip] x86: k8.h reference to node in node_to_k8_nb_misc for !CONFIG_K8_NB Jaswinder Singh Rajput
2009-04-14 16:52 ` Ingo Molnar [this message]
2009-04-14 17:07   ` Jaswinder Singh Rajput
2009-04-14 17:17     ` Ingo Molnar
2009-04-14 17:34       ` Jaswinder Singh Rajput

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=20090414165241.GB2089@elte.hu \
    --to=mingo@elte.hu \
    --cc=andreas.herrmann3@amd.com \
    --cc=jaswinder@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.langsdorf@amd.com \
    --cc=x86@kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.