summaryrefslogtreecommitdiff
path: root/arch/x86/kernel/cpu
diff options
context:
space:
mode:
authorYury Norov <ynorov@nvidia.com>2025-12-22 14:11:38 -0500
committerYury Norov <ynorov@nvidia.com>2026-03-23 13:33:51 -0400
commitc6a98dff41bfb4ccc2c7f4ed596bcbf6994d5d1a (patch)
tree22e648f251ec8ee01604c80b5d63ad6d4a3b09bc /arch/x86/kernel/cpu
parentbf31ddc14f8c6bcd4987c31fe2bc9e93e433b41a (diff)
downloadlwn-c6a98dff41bfb4ccc2c7f4ed596bcbf6994d5d1a.tar.gz
lwn-c6a98dff41bfb4ccc2c7f4ed596bcbf6994d5d1a.zip
x86/topology: use bitmap_weight_from()
Switch topo_unit_count() to use bitmap_weight_from(). Signed-off-by: Yury Norov <ynorov@nvidia.com>
Diffstat (limited to 'arch/x86/kernel/cpu')
-rw-r--r--arch/x86/kernel/cpu/topology.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/arch/x86/kernel/cpu/topology.c b/arch/x86/kernel/cpu/topology.c
index eafcb1fc185a..4913b64ec592 100644
--- a/arch/x86/kernel/cpu/topology.c
+++ b/arch/x86/kernel/cpu/topology.c
@@ -204,15 +204,11 @@ fwbug:
static unsigned int topo_unit_count(u32 lvlid, enum x86_topology_domains at_level,
unsigned long *map)
{
- unsigned int id, end, cnt = 0;
+ unsigned int end;
/* Calculate the exclusive end */
end = lvlid + (1U << x86_topo_system.dom_shifts[at_level]);
-
- /* Unfortunately there is no bitmap_weight_range() */
- for (id = find_next_bit(map, end, lvlid); id < end; id = find_next_bit(map, end, ++id))
- cnt++;
- return cnt;
+ return bitmap_weight_from(map, lvlid, end);
}
static __init void topo_register_apic(u32 apic_id, u32 acpi_id, bool present)