Commit ec0f9626 authored by Yuntao Wang's avatar Yuntao Wang Committed by Rafael J. Wysocki
Browse files

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: default avatarYuntao Wang <ytcoode@gmail.com>
[ rjw: Changelog edits ]
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent 9ecc3b38
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -67,9 +67,9 @@ int acpi_map_pxm_to_node(int pxm)
	node = pxm_to_node_map[pxm];

	if (node == NUMA_NO_NODE) {
		if (nodes_weight(nodes_found_map) >= MAX_NUMNODES)
			return NUMA_NO_NODE;
		node = first_unset_node(nodes_found_map);
		if (node >= MAX_NUMNODES)
			return NUMA_NO_NODE;
		__acpi_map_pxm_to_node(pxm, node);
		node_set(node, nodes_found_map);
	}