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.
Unified · Split
| @@ -183,10 +183,6 @@ extern bool printk_timed_ratelimit(unsigned long *caller_jiffies, · 182 unmodified lines | |||
| 183 | extern int printk_delay_msec; | 183 | extern int printk_delay_msec; |
| 184 | extern int dmesg_restrict; | 184 | extern int dmesg_restrict; |
| 185 | 185 | ||
| 186 | extern int | ||
| 187 | devkmsg_sysctl_set_loglvl(struct ctl_table *table, int write, void *buf, | ||
| 188 | size_t *lenp, loff_t *ppos); | ||
| 189 | |||
| 190 | extern void wake_up_klogd(void); | 186 | extern void wake_up_klogd(void); |
| 191 | 187 | ||
| 192 | char *log_buf_addr_get(void); | 188 | char *log_buf_addr_get(void); |
| @@ -6,6 +6,8 @@ · 5 unmodified lines | |||
| 6 | 6 | ||
| 7 | #if defined(CONFIG_PRINTK) && defined(CONFIG_SYSCTL) | 7 | #if defined(CONFIG_PRINTK) && defined(CONFIG_SYSCTL) |
| 8 | void __init printk_sysctl_init(void); | 8 | void __init printk_sysctl_init(void); |
| 9 | int devkmsg_sysctl_set_loglvl(struct ctl_table *table, int write, | ||
| 10 | void *buffer, size_t *lenp, loff_t *ppos); | ||
| 9 | #else | 11 | #else |
| 10 | #define printk_sysctl_init() do { } while (0) | 12 | #define printk_sysctl_init() do { } while (0) |
| 11 | #endif | 13 | #endif |
| @@ -171,7 +171,7 @@ static int __init control_devkmsg(char *str) · 170 unmodified lines | |||
| 171 | __setup("printk.devkmsg=", control_devkmsg); | 171 | __setup("printk.devkmsg=", control_devkmsg); |
| 172 | 172 | ||
| 173 | char devkmsg_log_str[DEVKMSG_STR_MAX_SIZE] = "ratelimit"; | 173 | char devkmsg_log_str[DEVKMSG_STR_MAX_SIZE] = "ratelimit"; |
| 174 | 174 | #if defined(CONFIG_PRINTK) && defined(CONFIG_SYSCTL) | |
| 175 | int devkmsg_sysctl_set_loglvl(struct ctl_table *table, int write, | 175 | int devkmsg_sysctl_set_loglvl(struct ctl_table *table, int write, |
| 176 | void *buffer, size_t *lenp, loff_t *ppos) | 176 | void *buffer, size_t *lenp, loff_t *ppos) |
| 177 | { | 177 | { |
| @@ -210,6 +210,7 @@ int devkmsg_sysctl_set_loglvl(struct ctl_table *table, int write, · 32 unmodified lines | |||
| 210 | 210 | ||
| 211 | return 0; | 211 | return 0; |
| 212 | } | 212 | } |
| 213 | #endif /* CONFIG_PRINTK && CONFIG_SYSCTL */ | ||
| 213 | 214 | ||
| 214 | /* Number of registered extended console drivers. */ | 215 | /* Number of registered extended console drivers. */ |
| 215 | static int nr_ext_console_drivers; | 216 | static int nr_ext_console_drivers; |