linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [patch 2/3] x86/srat: use NUMA_NO_NODE
       [not found] <20131115221403.74AF31CA2E5@corp2gmr1-1.eem.corp.google.com>
@ 2013-11-19  8:27 ` Ingo Molnar
  0 siblings, 0 replies; only message in thread
From: Ingo Molnar @ 2013-11-19  8:27 UTC (permalink / raw)
  To: akpm; +Cc: mingo, hpa, tglx, wujianguo, mingo, rientjes, linux-kernel


* 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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2013-11-19  8:27 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20131115221403.74AF31CA2E5@corp2gmr1-1.eem.corp.google.com>
2013-11-19  8:27 ` [patch 2/3] x86/srat: use NUMA_NO_NODE Ingo Molnar

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).