Skip to content

Commit 75060b6

Browse files
t-8chakpm00
authored andcommitted
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 <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
1 parent adc2c8d commit 75060b6

File tree

2 files changed

+12
-17
lines changed

2 files changed

+12
-17
lines changed

include/linux/nmi.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -216,13 +216,6 @@ void watchdog_update_hrtimer_threshold(u64 period);
216216
static inline void watchdog_update_hrtimer_threshold(u64 period) { }
217217
#endif
218218

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-
226219
#ifdef CONFIG_HAVE_ACPI_APEI_NMI
227220
#include <asm/nmi.h>
228221
#endif

kernel/watchdog.c

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -796,8 +796,8 @@ static int proc_watchdog_common(int which, struct ctl_table *table, int write,
796796
/*
797797
* /proc/sys/kernel/watchdog
798798
*/
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)
801801
{
802802
return proc_watchdog_common(WATCHDOG_HARDLOCKUP_ENABLED |
803803
WATCHDOG_SOFTOCKUP_ENABLED,
@@ -807,30 +807,32 @@ int proc_watchdog(struct ctl_table *table, int write,
807807
/*
808808
* /proc/sys/kernel/nmi_watchdog
809809
*/
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)
812812
{
813813
if (!watchdog_hardlockup_available && write)
814814
return -ENOTSUPP;
815815
return proc_watchdog_common(WATCHDOG_HARDLOCKUP_ENABLED,
816816
table, write, buffer, lenp, ppos);
817817
}
818818

819+
#ifdef CONFIG_SOFTLOCKUP_DETECTOR
819820
/*
820821
* /proc/sys/kernel/soft_watchdog
821822
*/
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)
824825
{
825826
return proc_watchdog_common(WATCHDOG_SOFTOCKUP_ENABLED,
826827
table, write, buffer, lenp, ppos);
827828
}
829+
#endif
828830

829831
/*
830832
* /proc/sys/kernel/watchdog_thresh
831833
*/
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)
834836
{
835837
int err, old;
836838

@@ -852,8 +854,8 @@ int proc_watchdog_thresh(struct ctl_table *table, int write,
852854
* user to specify a mask that will include cpus that have not yet
853855
* been brought online, if desired.
854856
*/
855-
int proc_watchdog_cpumask(struct ctl_table *table, int write,
856-
void *buffer, size_t *lenp, loff_t *ppos)
857+
static int proc_watchdog_cpumask(struct ctl_table *table, int write,
858+
void *buffer, size_t *lenp, loff_t *ppos)
857859
{
858860
int err;
859861

0 commit comments

Comments
 (0)