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

Configure Feed

Select the types of activity you want to include in your feed.

watchdog/core: remove sysctl handlers from public header

The functions are only used in the file where they are defined. Remove
them from the header and make them static.

Also guard proc_soft_watchdog with a #define-guard as it is not used
otherwise.

Link: https://lkml.kernel.org/r/20240306-const-sysctl-prep-watchdog-v1-1-bd45da3a41cf@weissschuh.net
Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

Thomas Weißschuh and committed by
Andrew Morton
75060b6e adc2c8d0

+12 -17
-7
include/linux/nmi.h
··· 216 216 static inline void watchdog_update_hrtimer_threshold(u64 period) { } 217 217 #endif 218 218 219 - struct ctl_table; 220 - int proc_watchdog(struct ctl_table *, int, void *, size_t *, loff_t *); 221 - int proc_nmi_watchdog(struct ctl_table *, int , void *, size_t *, loff_t *); 222 - int proc_soft_watchdog(struct ctl_table *, int , void *, size_t *, loff_t *); 223 - int proc_watchdog_thresh(struct ctl_table *, int , void *, size_t *, loff_t *); 224 - int proc_watchdog_cpumask(struct ctl_table *, int, void *, size_t *, loff_t *); 225 - 226 219 #ifdef CONFIG_HAVE_ACPI_APEI_NMI 227 220 #include <asm/nmi.h> 228 221 #endif
+12 -10
kernel/watchdog.c
··· 796 796 /* 797 797 * /proc/sys/kernel/watchdog 798 798 */ 799 - int proc_watchdog(struct ctl_table *table, int write, 800 - void *buffer, size_t *lenp, loff_t *ppos) 799 + static int proc_watchdog(struct ctl_table *table, int write, 800 + void *buffer, size_t *lenp, loff_t *ppos) 801 801 { 802 802 return proc_watchdog_common(WATCHDOG_HARDLOCKUP_ENABLED | 803 803 WATCHDOG_SOFTOCKUP_ENABLED, ··· 807 807 /* 808 808 * /proc/sys/kernel/nmi_watchdog 809 809 */ 810 - int proc_nmi_watchdog(struct ctl_table *table, int write, 811 - void *buffer, size_t *lenp, loff_t *ppos) 810 + static int proc_nmi_watchdog(struct ctl_table *table, int write, 811 + void *buffer, size_t *lenp, loff_t *ppos) 812 812 { 813 813 if (!watchdog_hardlockup_available && write) 814 814 return -ENOTSUPP; ··· 816 816 table, write, buffer, lenp, ppos); 817 817 } 818 818 819 + #ifdef CONFIG_SOFTLOCKUP_DETECTOR 819 820 /* 820 821 * /proc/sys/kernel/soft_watchdog 821 822 */ 822 - int proc_soft_watchdog(struct ctl_table *table, int write, 823 - void *buffer, size_t *lenp, loff_t *ppos) 823 + static int proc_soft_watchdog(struct ctl_table *table, int write, 824 + void *buffer, size_t *lenp, loff_t *ppos) 824 825 { 825 826 return proc_watchdog_common(WATCHDOG_SOFTOCKUP_ENABLED, 826 827 table, write, buffer, lenp, ppos); 827 828 } 829 + #endif 828 830 829 831 /* 830 832 * /proc/sys/kernel/watchdog_thresh 831 833 */ 832 - int proc_watchdog_thresh(struct ctl_table *table, int write, 833 - void *buffer, size_t *lenp, loff_t *ppos) 834 + static int proc_watchdog_thresh(struct ctl_table *table, int write, 835 + void *buffer, size_t *lenp, loff_t *ppos) 834 836 { 835 837 int err, old; 836 838 ··· 854 852 * user to specify a mask that will include cpus that have not yet 855 853 * been brought online, if desired. 856 854 */ 857 - int proc_watchdog_cpumask(struct ctl_table *table, int write, 858 - void *buffer, size_t *lenp, loff_t *ppos) 855 + static int proc_watchdog_cpumask(struct ctl_table *table, int write, 856 + void *buffer, size_t *lenp, loff_t *ppos) 859 857 { 860 858 int err; 861 859