From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754329AbbLTJoM (ORCPT ); Sun, 20 Dec 2015 04:44:12 -0500 Received: from mga11.intel.com ([192.55.52.93]:43788 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754162AbbLTJoJ convert rfc822-to-8bit (ORCPT ); Sun, 20 Dec 2015 04:44:09 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,453,1444719600"; d="scan'208";a="16423504" From: "Winkler, Tomas" To: Guenter Roeck , Greg Kroah-Hartman , Wim Van Sebroeck CC: "Usyskin, Alexander" , "linux-watchdog@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: RE: [char-misc-next 4/7] watchdog: mei_wdt: add status debugfs entry Thread-Topic: [char-misc-next 4/7] watchdog: mei_wdt: add status debugfs entry Thread-Index: AQHRONpqxCGjfjEn80Gi2Kw9yMq3HZ7Q0xSAgALP6+A= Date: Sun, 20 Dec 2015 09:44:05 +0000 Message-ID: <5B8DA87D05A7694D9FA63FD143655C1B540EE5A6@hasmsx108.ger.corp.intel.com> References: <1450363780-30008-1-git-send-email-tomas.winkler@intel.com> <1450363780-30008-5-git-send-email-tomas.winkler@intel.com> <56743795.6090700@roeck-us.net> In-Reply-To: <56743795.6090700@roeck-us.net> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.184.70.11] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > On 12/17/2015 06:49 AM, Tomas Winkler wrote: > > Add entry for dumping current watchdog internal state > > > > Signed-off-by: Tomas Winkler > > --- > > drivers/watchdog/mei_wdt.c | 84 > ++++++++++++++++++++++++++++++++++++++++++++++ > > 1 file changed, 84 insertions(+) > > > > diff --git a/drivers/watchdog/mei_wdt.c b/drivers/watchdog/mei_wdt.c > > index 3c97deb70d90..a3f1c1613c32 100644 > > --- a/drivers/watchdog/mei_wdt.c > > +++ b/drivers/watchdog/mei_wdt.c > > @@ -16,6 +16,7 @@ > > #include > > #include > > #include > > +#include > > > > #include > > #include > > @@ -54,6 +55,19 @@ enum mei_wdt_state { > > MEI_WDT_STOPPING, > > }; > > > > +#if IS_ENABLED(CONFIG_DEBUG_FS) > > +static const char *mei_wdt_state_str(enum mei_wdt_state state) > > +{ > > + switch (state) { > > + case MEI_WDT_IDLE: return "IDLE"; > > + case MEI_WDT_START: return "START"; > > + case MEI_WDT_RUNNING: return "RUNNING"; > > + case MEI_WDT_STOPPING: return "STOPPING"; > > + default: return "unknown"; > > Doesn't this cause checkpatch warnings ? It doesn't and also checkpatch.pl is just a help tool. > > > + } > > +} > > +#endif /* CONFIG_DEBUG_FS */ > > + > > Can you move this conditional code into the other #ifdef block below ? I'm removing the ifdef in the following patch so this is just for this path to not to spill warning the compilation w/o CONFIG_DEBUG_FS set. .start = mei_wdt_ops_start, > > @@ -348,6 +428,8 @@ static int mei_wdt_probe(struct mei_cl_device *cldev, > > if (ret) > > goto err_disable; > > > > + dbgfs_register(wdt); > > + > > return 0; > > > > err_disable: > > @@ -367,6 +449,8 @@ static int mei_wdt_remove(struct mei_cl_device *cldev) > > > > kref_put(&wdt->refcnt, mei_wdt_release); > > > > + dbgfs_deregister(wdt); > > + > > This should probably come before the call to kref_put() since it uses wdt. Good catch, will resend. Tomas