Skip to content

Commit ec0f962

Browse files
ytcooderafaeljw
authored andcommitted
ACPI: NUMA: Optimize the check for the availability of node values
The first_unset_node() function returns the first unused node in nodes_found_map. If all nodes are in use, the function returns MAX_NUMNODES. Use this return value to determine whether there are any available node values in nodes_found_map, eliminating the need to use nodes_weight() for this purpose. Signed-off-by: Yuntao Wang <ytcoode@gmail.com> [ rjw: Changelog edits ] Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
1 parent 9ecc3b3 commit ec0f962

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/acpi/numa/srat.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,9 @@ int acpi_map_pxm_to_node(int pxm)
6767
node = pxm_to_node_map[pxm];
6868

6969
if (node == NUMA_NO_NODE) {
70-
if (nodes_weight(nodes_found_map) >= MAX_NUMNODES)
71-
return NUMA_NO_NODE;
7270
node = first_unset_node(nodes_found_map);
71+
if (node >= MAX_NUMNODES)
72+
return NUMA_NO_NODE;
7373
__acpi_map_pxm_to_node(pxm, node);
7474
node_set(node, nodes_found_map);
7575
}

0 commit comments

Comments
 (0)