Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1306730

Re: [patch] watchdog: pnx833x_wdt: fix typo in MODULE_PARM_DESC

From Wim Van Sebroeck <wim@iguana.be>
Newsgroups linux.kernel
Subject Re: [patch] watchdog: pnx833x_wdt: fix typo in MODULE_PARM_DESC
Date 2016-01-11 22:50 +0100
Message-ID <qPSvE-89y-3@gated-at.bofh.it> (permalink)
References <qOD5E-5Ri-21@gated-at.bofh.it> <qOGwy-85j-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Hi All,

> On 01/08/2016 03:02 AM, Dan Carpenter wrote:
> >The module_param() is "pnx833x_wdt_timeout" and MODULE_PARM_DESC()
> >should match.
> >
> >Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> >
> >diff --git a/drivers/watchdog/pnx833x_wdt.c 
> >b/drivers/watchdog/pnx833x_wdt.c
> >index 882fdcb..69da25a 100644
> >--- a/drivers/watchdog/pnx833x_wdt.c
> >+++ b/drivers/watchdog/pnx833x_wdt.c
> >@@ -52,8 +52,9 @@ static int pnx833x_wdt_alive;
> >  /* Set default timeout in MHZ.*/
> >  static int pnx833x_wdt_timeout = PNX_WATCHDOG_TIMEOUT;
> >  module_param(pnx833x_wdt_timeout, int, 0);
> >-MODULE_PARM_DESC(timeout, "Watchdog timeout in Mhz. (68Mhz clock), 
> >default="
> >-			__MODULE_STRING(PNX_TIMEOUT_VALUE) "(30 seconds).");
> >+MODULE_PARM_DESC(pnx833x_wdt_timeout,
> >+		 "Watchdog timeout in Mhz. (68Mhz clock), default="
> >+		 __MODULE_STRING(PNX_TIMEOUT_VALUE) "(30 seconds).");
> 
> The intent here was to have a module parameter named 'timeout'.
> Of course that was never the case. Wonder if anyone ever noticed.
> The correct fix would be to use something like
> 	module_param_named(timeout, pnx833x_wdt_timeout, int, 0);
> but of course that would change the ABI. On the other side,
> 'timeout' is the documented module parameter in
> Documentation/watchdog/watchdog-parameters.txt, so one could argue
> that using module_param_named() would be a bug fix and not an ABI change.
> 
> Not really sure what the best approach is here. Wim, any comments ?
> Provide module_param_named() in _addition_ to the existing module_param(),
> maybe, if that is possible ?

Good question. If timeout would have been a timeout in seconds then I would
have said to go for module_param_named(). But since it is a value in Mhz, I
would rather go for Dan's patch. It will break the parameters for everyone
that has set in manually, but I personnaly think that people are using the
default value or change it via the watchdog daemon.
But if we change this, we should also make sure that 
Documentation/watchdog/watchdog-parameters.txt gets corrected.

Kind regards,
Wim.

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[patch] watchdog: pnx833x_wdt: fix typo in MODULE_PARM_DESC Dan Carpenter <dan.carpenter@oracle.com> - 2016-01-08 12:10 +0100
  Re: [patch] watchdog: pnx833x_wdt: fix typo in MODULE_PARM_DESC Guenter Roeck <linux@roeck-us.net> - 2016-01-08 15:50 +0100
    Re: [patch] watchdog: pnx833x_wdt: fix typo in MODULE_PARM_DESC Wim Van Sebroeck <wim@iguana.be> - 2016-01-11 22:50 +0100

csiph-web