Skip to content

Commit d3e6f62

Browse files
Patryk Wlazlynlenb
authored andcommitted
tools/power turbostat: Replace _Static_assert with BUILD_BUG_ON
So it compiles on GCC older than 9.0. Signed-off-by: Patryk Wlazlyn <[email protected]> Signed-off-by: Len Brown <[email protected]>
1 parent f04fcc7 commit d3e6f62

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

tools/power/x86/turbostat/turbostat.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
#include <stdbool.h>
3939
#include <assert.h>
4040
#include <linux/kernel.h>
41+
#include <linux/build_bug.h>
4142

4243
#define UNUSED(x) (void)(x)
4344

@@ -3467,7 +3468,7 @@ int get_rapl_counters(int cpu, int domain, struct core_data *c, struct pkg_data
34673468
}
34683469
}
34693470

3470-
_Static_assert(NUM_RAPL_COUNTERS == 7);
3471+
BUILD_BUG_ON(NUM_RAPL_COUNTERS != 7);
34713472
write_rapl_counter(&p->energy_pkg, rci, RAPL_RCI_INDEX_ENERGY_PKG);
34723473
write_rapl_counter(&p->energy_cores, rci, RAPL_RCI_INDEX_ENERGY_CORES);
34733474
write_rapl_counter(&p->energy_dram, rci, RAPL_RCI_INDEX_DRAM);

0 commit comments

Comments
 (0)