summaryrefslogtreecommitdiff
path: root/cpu.h
diff options
context:
space:
mode:
Diffstat (limited to 'cpu.h')
-rw-r--r--cpu.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/cpu.h b/cpu.h
index 6694bcf..c0c477b 100644
--- a/cpu.h
+++ b/cpu.h
@@ -75,10 +75,11 @@ cpu_id(void)
id = sched_getcpu();
- if (id == -1)
+ if (id == -1) {
return 0;
- else if (id >= NR_CPUS)
+ } else if (id >= NR_CPUS) {
id &= (NR_CPUS - 1);
+ }
return id;
#endif