The patch titled Subject: printk: fix build warning when CONFIG_PRINTK=n has been added to the -mm tree. Its filename is printk-fix-build-warning-when-config_printk=n.patch This patch should soon appear at https://ozlabs.org/~akpm/mmots/broken-out/printk-fix-build-warning-when-config_printk%3Dn.patch and later at https://ozlabs.org/~akpm/mmotm/broken-out/printk-fix-build-warning-when-config_printk%3Dn.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Xiaoming Ni <nixiaoming@xxxxxxxxxx> Subject: printk: fix build warning when CONFIG_PRINTK=n build warning when CONFIG_PRINTK=n kernel/printk/printk.c:175:5: warning: no previous prototype for 'devkmsg_sysctl_set_loglvl' [-Wmissing-prototypes] devkmsg_sysctl_set_loglvl() is only used in sysctl.c when CONFIG_PRINTK=y, but it participates in the build when CONFIG_PRINTK=n. So add compile dependency CONFIG_PRINTK=y && CONFIG_SYSCTL=y to fix the build warning. Link: https://lkml.kernel.org/r/20211129211943.640266-5-mcgrof@xxxxxxxxxx Signed-off-by: Xiaoming Ni <nixiaoming@xxxxxxxxxx> Signed-off-by: Luis Chamberlain <mcgrof@xxxxxxxxxx> Cc: Al Viro <viro@xxxxxxxxxxxxxxxxxx> Cc: Anil S Keshavamurthy <anil.s.keshavamurthy@xxxxxxxxx> Cc: Antti Palosaari <crope@xxxxxx> Cc: Christian Brauner <christian.brauner@xxxxxxxxxx> Cc: "David S. Miller" <davem@xxxxxxxxxxxxx> Cc: Eric Biederman <ebiederm@xxxxxxxxxxxx> Cc: Eric Biggers <ebiggers@xxxxxxxxxx> Cc: Iurii Zaikin <yzaikin@xxxxxxxxxx> Cc: Kees Cook <keescook@xxxxxxxxxxxx> Cc: Lukas Middendorf <kernel@xxxxxxxxxxx> Cc: Masami Hiramatsu <mhiramat@xxxxxxxxxx> Cc: Mauro Carvalho Chehab <mchehab@xxxxxxxxxx> Cc: "Naveen N. Rao" <naveen.n.rao@xxxxxxxxxxxxx> Cc: Stephen Kitt <steve@xxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- include/linux/printk.h | 4 ---- kernel/printk/internal.h | 2 ++ kernel/printk/printk.c | 3 ++- 3 files changed, 4 insertions(+), 5 deletions(-) --- a/include/linux/printk.h~printk-fix-build-warning-when-config_printk=n +++ a/include/linux/printk.h @@ -183,10 +183,6 @@ extern bool printk_timed_ratelimit(unsig extern int printk_delay_msec; extern int dmesg_restrict; -extern int -devkmsg_sysctl_set_loglvl(struct ctl_table *table, int write, void *buf, - size_t *lenp, loff_t *ppos); - extern void wake_up_klogd(void); char *log_buf_addr_get(void); --- a/kernel/printk/internal.h~printk-fix-build-warning-when-config_printk=n +++ a/kernel/printk/internal.h @@ -6,6 +6,8 @@ #if defined(CONFIG_PRINTK) && defined(CONFIG_SYSCTL) void __init printk_sysctl_init(void); +int devkmsg_sysctl_set_loglvl(struct ctl_table *table, int write, + void *buffer, size_t *lenp, loff_t *ppos); #else #define printk_sysctl_init() do { } while (0) #endif --- a/kernel/printk/printk.c~printk-fix-build-warning-when-config_printk=n +++ a/kernel/printk/printk.c @@ -171,7 +171,7 @@ static int __init control_devkmsg(char * __setup("printk.devkmsg=", control_devkmsg); char devkmsg_log_str[DEVKMSG_STR_MAX_SIZE] = "ratelimit"; - +#if defined(CONFIG_PRINTK) && defined(CONFIG_SYSCTL) int devkmsg_sysctl_set_loglvl(struct ctl_table *table, int write, void *buffer, size_t *lenp, loff_t *ppos) { @@ -210,6 +210,7 @@ int devkmsg_sysctl_set_loglvl(struct ctl return 0; } +#endif /* CONFIG_PRINTK && CONFIG_SYSCTL */ /* Number of registered extended console drivers. */ static int nr_ext_console_drivers; _ Patches currently in -mm which might be from nixiaoming@xxxxxxxxxx are sysctl-add-a-new-register_sysctl_init-interface.patch sysctl-move-some-boundary-constants-from-sysctlc-to-sysctl_vals.patch hung_task-move-hung_task-sysctl-interface-to-hung_taskc.patch watchdog-move-watchdog-sysctl-interface-to-watchdogc.patch sysctl-use-const-for-typically-used-max-min-proc-sysctls.patch sysctl-use-sysctl_zero-to-replace-some-static-int-zero-uses.patch aio-move-aio-sysctl-to-aioc.patch dnotify-move-dnotify-sysctl-to-dnotifyc.patch inotify-simplify-subdirectory-registration-with-register_sysctl.patch eventpoll-simplify-sysctl-declaration-with-register_sysctl.patch firmware_loader-move-firmware-sysctl-to-its-own-files.patch random-move-the-random-sysctl-declarations-to-its-own-file.patch printk-move-printk-sysctl-to-printk-sysctlc.patch scsi-sg-move-sg-big-buff-sysctl-to-scsi-sgc.patch stackleak-move-stack_erasing-sysctl-to-stackleakc.patch printk-fix-build-warning-when-config_printk=n.patch fs-coredump-move-coredump-sysctls-into-its-own-file.patch kprobe-move-sysctl_kprobes_optimization-to-kprobesc.patch