Skip to content

Commit 299d2a4

Browse files
committed
x86: fix cache ids on Intel
Clarify the previous commit 23bccbe1a75f6b299e871487b9dcd9b8a3d0e08a which wasn't simplified before push. Signed-off-by: Brice Goglin <[email protected]>
1 parent f485702 commit 299d2a4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

hwloc/topology-x86.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -753,8 +753,8 @@ static void look_proc(struct hwloc_backend *backend, struct procinfo *infos, uns
753753

754754
if (cpuid_type == intel) {
755755
/* round nbthreads_sharing to nearest power of two to build a mask (for clearing lower bits) */
756-
unsigned bits = hwloc_flsl(cache->nbthreads_sharing-1)+1;
757-
unsigned mask = ~((1U<<(bits-1)) - 1);
756+
unsigned bits = hwloc_flsl(cache->nbthreads_sharing-1);
757+
unsigned mask = ~((1U<<bits) - 1);
758758
cache->cacheid = infos->apicid & mask;
759759

760760
} else if (cpuid_type == amd) {

0 commit comments

Comments
 (0)