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>
This commit is contained in:
Heiko Carstens
2021-07-21 11:39:25 +02:00
parent 95655495e4
commit c68d463286
2 changed files with 4 additions and 0 deletions

View File

@@ -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",