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.
Showing the changes to kernel (2 of 3 files). Show all
Unified · Split
| @@ -6,6 +6,8 @@ · 5 unmodified lines | ||
| 6 | 6 | |
| 7 | 7 | #if defined(CONFIG_PRINTK) && defined(CONFIG_SYSCTL) |
| 8 | 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 | 11 | #else |
| 10 | 12 | #define printk_sysctl_init() do { } while (0) |
| 11 | 13 | #endif |
| @@ -171,7 +171,7 @@ static int __init control_devkmsg(char *str) · 170 unmodified lines | ||
| 171 | 171 | __setup("printk.devkmsg=", control_devkmsg); |
| 172 | 172 | |
| 173 | 173 | char devkmsg_log_str[DEVKMSG_STR_MAX_SIZE] = "ratelimit"; |
| 174 | − | |
| 174 | +#if defined(CONFIG_PRINTK) && defined(CONFIG_SYSCTL) | |
| 175 | 175 | int devkmsg_sysctl_set_loglvl(struct ctl_table *table, int write, |
| 176 | 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 | 211 | return 0; |
| 212 | 212 | } |
| 213 | +#endif /* CONFIG_PRINTK && CONFIG_SYSCTL */ | |
| 213 | 214 | |
| 214 | 215 | /* Number of registered extended console drivers. */ |
| 215 | 216 | static int nr_ext_console_drivers; |