summaryrefslogtreecommitdiffstats
path: root/drivers/acpi/numa.c
diff options
context:
space:
mode:
authorBjorn Helgaas <bhelgaas@google.com>2014-01-24 23:42:17 +0100
committerBjorn Helgaas <bhelgaas@google.com>2014-02-03 18:39:32 +0100
commit962fe9c91c5faa271e21c6ef589ff1df02fa13ed (patch)
tree102052ba5ff2b6835966e70a5b987bb014d623ff /drivers/acpi/numa.c
parentACPI / numa: Fix acpi_get_node() prototype (diff)
downloadlinux-962fe9c91c5faa271e21c6ef589ff1df02fa13ed.tar.xz
linux-962fe9c91c5faa271e21c6ef589ff1df02fa13ed.zip
ACPI / numa: Simplify acpi_get_node() style
Simplify control flow by removing local variable initialization and returning a constant as soon as possible. No functional change. Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/acpi/numa.c')
-rw-r--r--drivers/acpi/numa.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/acpi/numa.c b/drivers/acpi/numa.c
index dab7dac6b1a8..a7e779bfa2f6 100644
--- a/drivers/acpi/numa.c
+++ b/drivers/acpi/numa.c
@@ -333,12 +333,12 @@ int acpi_get_pxm(acpi_handle h)
int acpi_get_node(acpi_handle handle)
{
- int pxm, node = NUMA_NO_NODE;
+ int pxm;
pxm = acpi_get_pxm(handle);
- if (pxm >= 0 && pxm < MAX_PXM_DOMAINS)
- node = acpi_map_pxm_to_node(pxm);
+ if (pxm < 0 || pxm >= MAX_PXM_DOMAINS)
+ return NUMA_NO_NODE;
- return node;
+ return acpi_map_pxm_to_node(pxm);
}
EXPORT_SYMBOL(acpi_get_node);