Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

kallsyms: fix building without printk

Building kallsyms fails without CONFIG_PRINTK due to a missing
declaration:

kernel/kallsyms.c: In function 'kallsyms_show_value':
kernel/kallsyms.c:670:10: error: 'kptr_restrict' undeclared (first use in this function); did you mean 'keyring_restrict'?

This moves the declaration outside of the #ifdef guard, the definition
is already available without CONFIG_PRINTK.

Fixes: c0f3ea158939 ("stop using '%pK' for /proc/kallsyms pointer values")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
[ I clearly need to start doing "allnoconfig" builds too, or just have a
test branch for the 0day robot - Linus ]
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Arnd Bergmann and committed by
Linus Torvalds
01c313dd 37c6b6f2

+2 -1
+2 -1
include/linux/printk.h
··· 189 189 190 190 extern int printk_delay_msec; 191 191 extern int dmesg_restrict; 192 - extern int kptr_restrict; 193 192 194 193 extern int 195 194 devkmsg_sysctl_set_loglvl(struct ctl_table *table, int write, void __user *buf, ··· 278 279 { 279 280 } 280 281 #endif 282 + 283 + extern int kptr_restrict; 281 284 282 285 extern asmlinkage void dump_stack(void) __cold; 283 286