Without the explicit wide type, the shift operation may be performed
on a int which will result in implementation defined behaviour on a
system with more than 32 CPUs.
Signed-off-by: Thomas Graf <tgraf@noironetworks.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
break;
}
- if (cpu & (1 << id)) {
+ if (cpu & (1ULL << id)) {
/* We've already counted this package's cores. */
continue;
}
- cpu |= 1 << id;
+ cpu |= 1ULL << id;
/* Find the number of cores for this package. */
while (fgets(line, sizeof line, stream)) {