ACPI: MRRM: Use for_each_populated_zone() in get_node_num()

get_node_num() iterates over the populated zones of every online node
with a nested loop. for_each_populated_zone() iterates over the same
zones in the same order.

So use for_each_populated_zone() instead and remove the unused
variable.

No functional change.

Signed-off-by: Sang-Heon Jeon <ekffu200098@gmail.com>
Link: https://patch.msgid.link/20260821131530.3375820-1-ekffu200098@gmail.com
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
This commit is contained in:
Sang-Heon Jeon 2026-08-21 22:15:08 +09:00 committed by Rafael J. Wysocki
parent df2908090c
commit 72a35790da

View File

@ -36,17 +36,11 @@ static u32 mrrm_mem_entry_num;
static int get_node_num(struct mrrm_mem_range_entry *e)
{
unsigned int nid;
struct zone *zone;
for_each_online_node(nid) {
for (int z = 0; z < MAX_NR_ZONES; z++) {
struct zone *zone = NODE_DATA(nid)->node_zones + z;
if (!populated_zone(zone))
continue;
if (zone_intersects(zone, PHYS_PFN(e->base), PHYS_PFN(e->length)))
return zone_to_nid(zone);
}
for_each_populated_zone(zone) {
if (zone_intersects(zone, PHYS_PFN(e->base), PHYS_PFN(e->length)))
return zone_to_nid(zone);
}
return -ENOENT;