From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752845AbbBEUmO (ORCPT ); Thu, 5 Feb 2015 15:42:14 -0500 Received: from mx1.redhat.com ([209.132.183.28]:36824 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753849AbbBEUkq (ORCPT ); Thu, 5 Feb 2015 15:40:46 -0500 From: Don Zickus To: LKML Cc: Andrew Morton , Ulrich Obergfell , Don Zickus Subject: [PATCH 3/9] watchdog: move definition of 'watchdog_proc_mutex' outside of proc_dowatchdog() Date: Thu, 5 Feb 2015 15:40:19 -0500 Message-Id: <1423168825-156238-4-git-send-email-dzickus@redhat.com> In-Reply-To: <1423168825-156238-1-git-send-email-dzickus@redhat.com> References: <1423168825-156238-1-git-send-email-dzickus@redhat.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Ulrich Obergfell This series removes the proc_dowatchdog() function. 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 --- kernel/watchdog.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/kernel/watchdog.c b/kernel/watchdog.c index dcc4990..28c833b 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); -- 1.7.1