* [PATCH] watchdog: orion: use 0 for unset heartbeat
@ 2020-03-13 3:13 Chris Packham
2020-03-13 5:27 ` Guenter Roeck
0 siblings, 1 reply; 2+ messages in thread
From: Chris Packham @ 2020-03-13 3:13 UTC (permalink / raw)
To: wim, linux; +Cc: linux-watchdog, linux-kernel, Chris Packham
If the heartbeat module param is not specified we would get an error
message
watchdog: f1020300.watchdog: driver supplied timeout (4294967295) out of range
watchdog: f1020300.watchdog: falling back to default timeout (171)
This is because we were initialising heartbeat to -1. By removing the
initialisation (thus letting the C run time initialise it to 0) we
silence the warning message and the default timeout is still used.
Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
---
drivers/watchdog/orion_wdt.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/watchdog/orion_wdt.c b/drivers/watchdog/orion_wdt.c
index 8e6dfe76f9c9..4ddb4ea2e4a3 100644
--- a/drivers/watchdog/orion_wdt.c
+++ b/drivers/watchdog/orion_wdt.c
@@ -52,7 +52,7 @@
#define WDT_A370_RATIO (1 << WDT_A370_RATIO_SHIFT)
static bool nowayout = WATCHDOG_NOWAYOUT;
-static int heartbeat = -1; /* module parameter (seconds) */
+static int heartbeat; /* module parameter (seconds) */
struct orion_watchdog;
--
2.25.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] watchdog: orion: use 0 for unset heartbeat
2020-03-13 3:13 [PATCH] watchdog: orion: use 0 for unset heartbeat Chris Packham
@ 2020-03-13 5:27 ` Guenter Roeck
0 siblings, 0 replies; 2+ messages in thread
From: Guenter Roeck @ 2020-03-13 5:27 UTC (permalink / raw)
To: Chris Packham, wim; +Cc: linux-watchdog, linux-kernel
On 3/12/20 8:13 PM, Chris Packham wrote:
> If the heartbeat module param is not specified we would get an error
> message
>
> watchdog: f1020300.watchdog: driver supplied timeout (4294967295) out of range
> watchdog: f1020300.watchdog: falling back to default timeout (171)
>
> This is because we were initialising heartbeat to -1. By removing the
> initialisation (thus letting the C run time initialise it to 0) we
> silence the warning message and the default timeout is still used.
>
> Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
Good catch.
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
> ---
> drivers/watchdog/orion_wdt.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/watchdog/orion_wdt.c b/drivers/watchdog/orion_wdt.c
> index 8e6dfe76f9c9..4ddb4ea2e4a3 100644
> --- a/drivers/watchdog/orion_wdt.c
> +++ b/drivers/watchdog/orion_wdt.c
> @@ -52,7 +52,7 @@
> #define WDT_A370_RATIO (1 << WDT_A370_RATIO_SHIFT)
>
> static bool nowayout = WATCHDOG_NOWAYOUT;
> -static int heartbeat = -1; /* module parameter (seconds) */
> +static int heartbeat; /* module parameter (seconds) */
>
> struct orion_watchdog;
>
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-03-13 5:27 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-13 3:13 [PATCH] watchdog: orion: use 0 for unset heartbeat Chris Packham
2020-03-13 5:27 ` Guenter Roeck
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).