Skip to content

Commit

Permalink
ACPI / numa: Simplify acpi_get_node() style
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Bjorn Helgaas committed Feb 3, 2014
1 parent 486c79b commit 962fe9c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions drivers/acpi/numa.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

0 comments on commit 962fe9c

Please sign in to comment.