From: Ulrich Obergfell Date: Tue, 14 Apr 2015 22:44:01 +0000 (-0700) Subject: watchdog: move definition of 'watchdog_proc_mutex' outside of proc_dowatchdog() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=f54c2274f5515da6bae779c7340cd0dc69d0dd8d;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git watchdog: move definition of 'watchdog_proc_mutex' outside of proc_dowatchdog() This series removes proc_dowatchdog(). Since multiple new functions need the 'watchdog_proc_mutex' to serialize access to the watchdog parameters in /proc/sys/kernel, move the mutex outside of any function. Signed-off-by: Ulrich Obergfell Signed-off-by: Don Zickus Cc: Ingo Molnar Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/kernel/watchdog.c b/kernel/watchdog.c index dcc4990097a2..28c833b42124 100644 --- a/kernel/watchdog.c +++ b/kernel/watchdog.c @@ -701,6 +701,8 @@ static int proc_watchdog_update(void) } +static DEFINE_MUTEX(watchdog_proc_mutex); + /* * proc handler for /proc/sys/kernel/nmi_watchdog,watchdog_thresh */ @@ -710,7 +712,6 @@ int proc_dowatchdog(struct ctl_table *table, int write, { int err, old_thresh, old_enabled; bool old_hardlockup; - static DEFINE_MUTEX(watchdog_proc_mutex); mutex_lock(&watchdog_proc_mutex); old_thresh = ACCESS_ONCE(watchdog_thresh);