linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@kernel.org>
To: akpm@linux-foundation.org
Cc: mingo@elte.hu, hpa@zytor.com, tglx@linutronix.de,
	wujianguo@huawei.com, mingo@redhat.com, rientjes@google.com,
	linux-kernel@vger.kernel.org
Subject: Re: [patch 2/3] x86/srat: use NUMA_NO_NODE
Date: Tue, 19 Nov 2013 09:27:04 +0100	[thread overview]
Message-ID: <20131119082704.GA1243@gmail.com> (raw)
In-Reply-To: <20131115221403.74AF31CA2E5@corp2gmr1-1.eem.corp.google.com>


* akpm@linux-foundation.org <akpm@linux-foundation.org> wrote:

> From: Jianguo Wu <wujianguo@huawei.com>
> Subject: x86/srat: use NUMA_NO_NODE
> 
> setup_node() return NUMA_NO_NODE or valid node id(>=0), So use more
> appropriate "if (node == NUMA_NO_NODE)" instead of "if (node < 0)"
> 
> Signed-off-by: Jianguo Wu <wujianguo@huawei.com>
> Acked-by: David Rientjes <rientjes@google.com>
> Cc: Thomas Gleixner <tglx@linutronix.de>
> Cc: Ingo Molnar <mingo@redhat.com>
> Cc: "H. Peter Anvin" <hpa@zytor.com>
> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
> ---
> 
>  arch/x86/mm/srat.c |    6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff -puN arch/x86/mm/srat.c~x86-srat-use-numa_no_node arch/x86/mm/srat.c
> --- a/arch/x86/mm/srat.c~x86-srat-use-numa_no_node
> +++ a/arch/x86/mm/srat.c
> @@ -76,7 +76,7 @@ acpi_numa_x2apic_affinity_init(struct ac
>  		return;
>  	}
>  	node = setup_node(pxm);
> -	if (node < 0) {
> +	if (node == NUMA_NO_NODE) {
>  		printk(KERN_ERR "SRAT: Too many proximity domains %x\n", pxm);
>  		bad_srat();
>  		return;
> @@ -112,7 +112,7 @@ acpi_numa_processor_affinity_init(struct
>  	if (acpi_srat_revision >= 2)
>  		pxm |= *((unsigned int*)pa->proximity_domain_hi) << 8;
>  	node = setup_node(pxm);
> -	if (node < 0) {
> +	if (node == NUMA_NO_NODE) {
>  		printk(KERN_ERR "SRAT: Too many proximity domains %x\n", pxm);
>  		bad_srat();
>  		return;
> @@ -166,7 +166,7 @@ acpi_numa_memory_affinity_init(struct ac
>  		pxm &= 0xff;
>  
>  	node = setup_node(pxm);
> -	if (node < 0) {
> +	if (node == NUMA_NO_NODE) {
>  		printk(KERN_ERR "SRAT: Too many proximity domains.\n");
>  		goto out_err_bad_srat;
>  	}

Dunno, I think the 'node < 0' pattern is more readable and is in 
general more robust than explicit NUMA_NO_NODE use - as it would 
handle other errors as well, not just -1.

Thanks,

	Ingo

           reply	other threads:[~2013-11-19  8:27 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <20131115221403.74AF31CA2E5@corp2gmr1-1.eem.corp.google.com>]

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=20131119082704.GA1243@gmail.com \
    --to=mingo@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=mingo@redhat.com \
    --cc=rientjes@google.com \
    --cc=tglx@linutronix.de \
    --cc=wujianguo@huawei.com \
    /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;
as well as URLs for NNTP newsgroup(s).