Re: [PATCH 04/26] x86-64, NUMA: Unify{acpi|amd}_{numa_init|scan_nodes}() arguments and return values
From: Tejun Heo
Date: Mon Feb 14 2011 - 11:19:07 EST
On Mon, Feb 14, 2011 at 08:14:36AM -0800, Yinghai Lu wrote:
> when system have acpi support but SRAT is NOT there, new
> acpi_numa_init() will return 0 just like SRAT is there and correct.
> So it will skip AMD node scanning.
How does it return 0?
...
cnt = acpi_table_parse_srat(ACPI_SRAT_TYPE_MEMORY_AFFINITY,
acpi_parse_memory_affinity,
NR_NODE_MEMBLKS);
If there's no srat, cnt is zero.
}
/* SLIT: System Locality Information Table */
acpi_table_parse(ACPI_SIG_SLIT, acpi_parse_slit);
acpi_numa_arch_fixup();
if (cnt <= 0)
if cnt is zero, the if is taken
return cnt ?: -ENOENT;
and as cnt is zero, -ENOENT is returned.
return 0;
The function returns 0 iff cnt > 0.
--
tejun
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/