From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753246AbbKWT0M (ORCPT ); Mon, 23 Nov 2015 14:26:12 -0500 Received: from metis.ext.4.pengutronix.de ([92.198.50.35]:52564 "EHLO metis.ext.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753070AbbKWT0L (ORCPT ); Mon, 23 Nov 2015 14:26:11 -0500 Date: Mon, 23 Nov 2015 20:26:06 +0100 From: Uwe =?iso-8859-1?Q?Kleine-K=F6nig?= To: Guenter Roeck Cc: linux-watchdog@vger.kernel.org, Wim Van Sebroeck , linux-kernel@vger.kernel.org, Timo Kokkonen , linux-doc@vger.kernel.org, Jonathan Corbet Subject: Re: [PATCH v5 2/8] watchdog: Introduce WDOG_RUNNING flag Message-ID: <20151123192606.GB19888@pengutronix.de> References: <1448248865-21684-1-git-send-email-linux@roeck-us.net> <1448248865-21684-3-git-send-email-linux@roeck-us.net> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1448248865-21684-3-git-send-email-linux@roeck-us.net> User-Agent: Mutt/1.5.23 (2014-03-12) X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::c0 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello Guenter, On Sun, Nov 22, 2015 at 07:20:59PM -0800, Guenter Roeck wrote: > diff --git a/include/linux/watchdog.h b/include/linux/watchdog.h > index b535b02b1d7f..f0292d56caf0 100644 > --- a/include/linux/watchdog.h > +++ b/include/linux/watchdog.h > @@ -108,6 +108,7 @@ struct watchdog_device { > #define WDOG_ALLOW_RELEASE 2 /* Did we receive the magic char ? */ > #define WDOG_NO_WAY_OUT 3 /* Is 'nowayout' feature set ? */ > #define WDOG_UNREGISTERED 4 /* Has the device been unregistered */ > +#define WDOG_RUNNING 5 /* True if HW watchdog running */ > /* the following variables are for internal use only */ > struct mutex lock; > unsigned long last_keepalive; > @@ -124,6 +125,12 @@ static inline bool watchdog_active(struct watchdog_device *wdd) > return test_bit(WDOG_ACTIVE, &wdd->status); > } > > +/* Use the following function to check whether or not the watchdog is running */ I'd like to have this comment more clear to distinguish between device state and userspace view. Maybe also call the flag WDOG_HW_RUNNING to make this more clear? > +static inline bool watchdog_running(struct watchdog_device *wdd) > +{ > + return test_bit(WDOG_RUNNING, &wdd->status); > +} > + -- Pengutronix e.K. | Uwe Kleine-König | Industrial Linux Solutions | http://www.pengutronix.de/ |