[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <9d1b96a2-6709-819f-23aa-f91e9741a54d@roeck-us.net>
Date: Sun, 22 Oct 2023 17:03:19 -0700
From: Guenter Roeck <linux@...ck-us.net>
To: fenghui <fenghui@...china.com>, wim@...ux-watchdog.org
Cc: linux-watchdog@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] watchdog_dev: Remove unnecessary ‘0’ values from err
On 10/21/23 04:05, fenghui wrote:
> err is assigned first, so it does not need to initialize the assignment.
>
> Signed-off-by: fenghui <fenghui@...china.com>
> ---
> drivers/watchdog/watchdog_dev.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/watchdog/watchdog_dev.c b/drivers/watchdog/watchdog_dev.c
> index 15df74e11a59..0868ccbcf92b 100644
> --- a/drivers/watchdog/watchdog_dev.c
> +++ b/drivers/watchdog/watchdog_dev.c
> @@ -291,7 +291,7 @@ static int watchdog_start(struct watchdog_device *wdd)
> */
> static int watchdog_stop(struct watchdog_device *wdd)
> {
> - int err = 0;
> + int err;
>
> if (!watchdog_active(wdd))
> return 0;
NACK
...
if (wdd->ops->stop) {
clear_bit(WDOG_HW_RUNNING, &wdd->status);
err = wdd->ops->stop(wdd);
trace_watchdog_stop(wdd, err);
} else {
set_bit(WDOG_HW_RUNNING, &wdd->status); <-- err is not set in this path
}
Powered by blists - more mailing lists