summaryrefslogtreecommitdiffstats
path: root/arch/s390/kernel
diff options
context:
space:
mode:
authorHeiko Carstens <hca@linux.ibm.com>2021-07-21 11:39:25 +0200
committerHeiko Carstens <hca@linux.ibm.com>2021-07-27 09:39:20 +0200
commitc68d463286cd481cfbc4b0207fafef1ef5506d3b (patch)
tree219bb31ff7e93948d44e90ab28db0a2ec498918f /arch/s390/kernel
parent95655495e404740fd8624398ed92b1e5afb5672f (diff)
downloadlinux-c68d463286cd481cfbc4b0207fafef1ef5506d3b.tar.bz2
s390/hwcaps: add sanity checks
Add BUILD_BUG_ON() sanity checks to make sure the hwcap string array contains a string for each hwcap. Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Diffstat (limited to 'arch/s390/kernel')
-rw-r--r--arch/s390/kernel/processor.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/arch/s390/kernel/processor.c b/arch/s390/kernel/processor.c
index 1eb2410d9fb2..e0efe946d8f0 100644
--- a/arch/s390/kernel/processor.c
+++ b/arch/s390/kernel/processor.c
@@ -141,6 +141,8 @@ static void show_cpu_summary(struct seq_file *m, void *v)
};
int i, cpu;
+ BUILD_BUG_ON(ARRAY_SIZE(hwcap_str) != HWCAP_NR_MAX);
+ BUILD_BUG_ON(ARRAY_SIZE(int_hwcap_str) != HWCAP_INT_NR_MAX);
seq_printf(m, "vendor_id : IBM/S390\n"
"# processors : %i\n"
"bogomips per cpu: %lu.%02lu\n",