* [v3,1/1] hwmon:(nct7904) Set default timeout
@ 2020-05-27 6:16 yuechao.zhao
2020-05-27 6:47 ` Guenter Roeck
0 siblings, 1 reply; 2+ messages in thread
From: yuechao.zhao @ 2020-05-27 6:16 UTC (permalink / raw)
To: 345351830
Cc: amy.shih, oakley.ding, jia.sui, Yuechao Zhao, Jean Delvare,
Guenter Roeck, linux-hwmon, linux-kernel
From: Yuechao Zhao <yuechao.zhao@advantech.com.cn>
The timeout module parameter should not be used for setting the default
timeout. Because, if you set the timeout = 0, the default timeout will
be meaningless. And the timeout module parameter of 0 means "no timeout
module paraameter specified".
Signed-off-by: Yuechao Zhao <yuechao.zhao@advantech.com.cn>
---
Change in v3:
- replace 'static int timeout = WATCHDOG_TIMEOUT;' with 'static int timeout;'
- fixed typo
Change in v2:
- modify subject to 'hwmon:(nct7904) Set default timeout'
---
drivers/hwmon/nct7904.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/hwmon/nct7904.c b/drivers/hwmon/nct7904.c
index 18c95be..b042569 100644
--- a/drivers/hwmon/nct7904.c
+++ b/drivers/hwmon/nct7904.c
@@ -111,14 +111,14 @@
#define MIN_TIMEOUT (1 * 60)
#define MAX_TIMEOUT (255 * 60)
-static int timeout = WATCHDOG_TIMEOUT;
+static int timeout;
module_param(timeout, int, 0);
MODULE_PARM_DESC(timeout, "Watchdog timeout in minutes. 1 <= timeout <= 255, default="
- __MODULE_STRING(WATCHODOG_TIMEOUT) ".");
+ __MODULE_STRING(WATCHDOG_TIMEOUT) ".");
static bool nowayout = WATCHDOG_NOWAYOUT;
module_param(nowayout, bool, 0);
-MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started once started (default="
+MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default="
__MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
static const unsigned short normal_i2c[] = {
@@ -1147,7 +1147,7 @@ static int nct7904_probe(struct i2c_client *client,
data->wdt.ops = &nct7904_wdt_ops;
data->wdt.info = &nct7904_wdt_info;
- data->wdt.timeout = timeout * 60; /* in seconds */
+ data->wdt.timeout = WATCHDOG_TIMEOUT * 60; /* Set default timeout */
data->wdt.min_timeout = MIN_TIMEOUT;
data->wdt.max_timeout = MAX_TIMEOUT;
data->wdt.parent = &client->dev;
--
1.8.3.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [v3,1/1] hwmon:(nct7904) Set default timeout
2020-05-27 6:16 [v3,1/1] hwmon:(nct7904) Set default timeout yuechao.zhao
@ 2020-05-27 6:47 ` Guenter Roeck
0 siblings, 0 replies; 2+ messages in thread
From: Guenter Roeck @ 2020-05-27 6:47 UTC (permalink / raw)
To: yuechao.zhao
Cc: 345351830, amy.shih, oakley.ding, jia.sui, Jean Delvare,
linux-hwmon, linux-kernel
On Wed, May 27, 2020 at 06:16:59AM +0000, yuechao.zhao@advantech.com.cn wrote:
> From: Yuechao Zhao <yuechao.zhao@advantech.com.cn>
>
> The timeout module parameter should not be used for setting the default
> timeout. Because, if you set the timeout = 0, the default timeout will
> be meaningless. And the timeout module parameter of 0 means "no timeout
> module paraameter specified".
>
> Signed-off-by: Yuechao Zhao <yuechao.zhao@advantech.com.cn>
Applied.
Thanks,
Guenter
> ---
> Change in v3:
> - replace 'static int timeout = WATCHDOG_TIMEOUT;' with 'static int timeout;'
> - fixed typo
>
> Change in v2:
> - modify subject to 'hwmon:(nct7904) Set default timeout'
> ---
> drivers/hwmon/nct7904.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/hwmon/nct7904.c b/drivers/hwmon/nct7904.c
> index 18c95be..b042569 100644
> --- a/drivers/hwmon/nct7904.c
> +++ b/drivers/hwmon/nct7904.c
> @@ -111,14 +111,14 @@
> #define MIN_TIMEOUT (1 * 60)
> #define MAX_TIMEOUT (255 * 60)
>
> -static int timeout = WATCHDOG_TIMEOUT;
> +static int timeout;
> module_param(timeout, int, 0);
> MODULE_PARM_DESC(timeout, "Watchdog timeout in minutes. 1 <= timeout <= 255, default="
> - __MODULE_STRING(WATCHODOG_TIMEOUT) ".");
> + __MODULE_STRING(WATCHDOG_TIMEOUT) ".");
>
> static bool nowayout = WATCHDOG_NOWAYOUT;
> module_param(nowayout, bool, 0);
> -MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started once started (default="
> +MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default="
> __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
>
> static const unsigned short normal_i2c[] = {
> @@ -1147,7 +1147,7 @@ static int nct7904_probe(struct i2c_client *client,
> data->wdt.ops = &nct7904_wdt_ops;
> data->wdt.info = &nct7904_wdt_info;
>
> - data->wdt.timeout = timeout * 60; /* in seconds */
> + data->wdt.timeout = WATCHDOG_TIMEOUT * 60; /* Set default timeout */
> data->wdt.min_timeout = MIN_TIMEOUT;
> data->wdt.max_timeout = MAX_TIMEOUT;
> data->wdt.parent = &client->dev;
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-05-27 6:47 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-27 6:16 [v3,1/1] hwmon:(nct7904) Set default timeout yuechao.zhao
2020-05-27 6:47 ` Guenter Roeck
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.