Skip to content

Commit 01c313d

Browse files
arndbtorvalds
authored andcommitted
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: c0f3ea1 ("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>
1 parent 37c6b6f commit 01c313d

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎include/linux/printk.h‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,6 @@ extern bool printk_timed_ratelimit(unsigned long *caller_jiffies,
189189

190190
extern int printk_delay_msec;
191191
extern int dmesg_restrict;
192-
extern int kptr_restrict;
193192

194193
extern int
195194
devkmsg_sysctl_set_loglvl(struct ctl_table *table, int write, void __user *buf,
@@ -280,6 +279,8 @@ static inline void printk_safe_flush_on_panic(void)
280279
}
281280
#endif
282281

282+
extern int kptr_restrict;
283+
283284
extern asmlinkage void dump_stack(void) __cold;
284285

285286
#ifndef pr_fmt

0 commit comments

Comments
 (0)