summaryrefslogtreecommitdiffstats
path: root/tools/power
diff options
context:
space:
mode:
authorPatryk Wlazlyn <patryk.wlazlyn@linux.intel.com>2024-04-23 11:59:49 +0200
committerLen Brown <len.brown@intel.com>2024-05-01 06:04:24 +0200
commitd3e6f6253895f499b63bac261b81732f9efc4902 (patch)
tree20645c05a67d7e0e267e0a5c3ad47c3117ea887b /tools/power
parenttools/power turbostat: Add ARL-H support (diff)
downloadlinux-d3e6f6253895f499b63bac261b81732f9efc4902.tar.xz
linux-d3e6f6253895f499b63bac261b81732f9efc4902.zip
tools/power turbostat: Replace _Static_assert with BUILD_BUG_ON
So it compiles on GCC older than 9.0. Signed-off-by: Patryk Wlazlyn <patryk.wlazlyn@linux.intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'tools/power')
-rw-r--r--tools/power/x86/turbostat/turbostat.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/power/x86/turbostat/turbostat.c b/tools/power/x86/turbostat/turbostat.c
index fadf96934f4e..bd6cb31b7099 100644
--- a/tools/power/x86/turbostat/turbostat.c
+++ b/tools/power/x86/turbostat/turbostat.c
@@ -38,6 +38,7 @@
#include <stdbool.h>
#include <assert.h>
#include <linux/kernel.h>
+#include <linux/build_bug.h>
#define UNUSED(x) (void)(x)
@@ -3467,7 +3468,7 @@ int get_rapl_counters(int cpu, int domain, struct core_data *c, struct pkg_data
}
}
- _Static_assert(NUM_RAPL_COUNTERS == 7);
+ BUILD_BUG_ON(NUM_RAPL_COUNTERS != 7);
write_rapl_counter(&p->energy_pkg, rci, RAPL_RCI_INDEX_ENERGY_PKG);
write_rapl_counter(&p->energy_cores, rci, RAPL_RCI_INDEX_ENERGY_CORES);
write_rapl_counter(&p->energy_dram, rci, RAPL_RCI_INDEX_DRAM);