summaryrefslogtreecommitdiffstats
path: root/src/proc_softirqs.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/proc_softirqs.c')
-rw-r--r--src/proc_softirqs.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/proc_softirqs.c b/src/proc_softirqs.c
index a1b9947e..cd7440b0 100644
--- a/src/proc_softirqs.c
+++ b/src/proc_softirqs.c
@@ -18,10 +18,10 @@ struct interrupt {
// since each interrupt is variable in size
// we use this to calculate its record size
-#define recordsize(cpus) (sizeof(struct interrupt) + (cpus * sizeof(struct cpu_interrupt)))
+#define recordsize(cpus) (sizeof(struct interrupt) + ((cpus) * sizeof(struct cpu_interrupt)))
// given a base, get a pointer to each record
-#define irrindex(base, line, cpus) ((struct interrupt *)&((char *)(base))[line * recordsize(cpus)])
+#define irrindex(base, line, cpus) ((struct interrupt *)&((char *)(base))[(line) * recordsize(cpus)])
static inline struct interrupt *get_interrupts_array(size_t lines, int cpus) {
static struct interrupt *irrs = NULL;