From: Sascha Hauer <sha@pengutronix.de>
To: Ahmad Fatoum <a.fatoum@pengutronix.de>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH master 1/2] sandbox: watchdog: don't return positive values from set_timeout
Date: Mon, 3 May 2021 12:38:56 +0200 [thread overview]
Message-ID: <20210503103856.GV19819@pengutronix.de> (raw)
In-Reply-To: <20210426113408.24903-1-a.fatoum@pengutronix.de>
On Mon, Apr 26, 2021 at 01:34:07PM +0200, Ahmad Fatoum wrote:
> linux_watchdog_set_timeout() does return alarm(), which can never fail
> and returns either zero or a positive value.
>
> watchdog::set_timeout on the other hand should return either 0 or
> a negative number on error.
>
> Ignore linux_watchdog_set_timeout()'s return value, so
> watchdog_set_timeout propagates the correct value.
>
> This fixes an issue where seconds_to_expire wasn't updated on
> subsequent pings of this watchdog.
>
> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
> ---
> arch/sandbox/board/watchdog.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
Applied, thanks
Sascha
>
> diff --git a/arch/sandbox/board/watchdog.c b/arch/sandbox/board/watchdog.c
> index 336451282fd3..e1cff7a0bf0b 100644
> --- a/arch/sandbox/board/watchdog.c
> +++ b/arch/sandbox/board/watchdog.c
> @@ -29,7 +29,8 @@ static int sandbox_watchdog_set_timeout(struct watchdog *wdd, unsigned int timeo
> if (timeout > wdd->timeout_max)
> return -EINVAL;
>
> - return linux_watchdog_set_timeout(timeout);
> + linux_watchdog_set_timeout(timeout);
> + return 0;
> }
>
> static int sandbox_watchdog_probe(struct device_d *dev)
> --
> 2.29.2
>
>
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
>
--
Pengutronix e.K. | |
Steuerwalder Str. 21 | http://www.pengutronix.de/ |
31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
prev parent reply other threads:[~2021-05-03 10:40 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-26 11:34 Ahmad Fatoum
2021-04-26 11:34 ` [PATCH master 2/2] Documentation: user: watchdog: sync with current state Ahmad Fatoum
2021-05-03 10:38 ` Sascha Hauer [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210503103856.GV19819@pengutronix.de \
--to=sha@pengutronix.de \
--cc=a.fatoum@pengutronix.de \
--cc=barebox@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox