Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

x86/topology: use bitmap_weight_from()

Switch topo_unit_count() to use bitmap_weight_from().

Signed-off-by: Yury Norov <ynorov@nvidia.com>

+2 -6
+2 -6
arch/x86/kernel/cpu/topology.c
··· 204 204 static unsigned int topo_unit_count(u32 lvlid, enum x86_topology_domains at_level, 205 205 unsigned long *map) 206 206 { 207 - unsigned int id, end, cnt = 0; 207 + unsigned int end; 208 208 209 209 /* Calculate the exclusive end */ 210 210 end = lvlid + (1U << x86_topo_system.dom_shifts[at_level]); 211 - 212 - /* Unfortunately there is no bitmap_weight_range() */ 213 - for (id = find_next_bit(map, end, lvlid); id < end; id = find_next_bit(map, end, ++id)) 214 - cnt++; 215 - return cnt; 211 + return bitmap_weight_from(map, lvlid, end); 216 212 } 217 213 218 214 static __init void topo_register_apic(u32 apic_id, u32 acpi_id, bool present)