All of lore.kernel.org
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: fenghui <fenghui@nfschina.com>, wim@linux-watchdog.org
Cc: linux-watchdog@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] watchdog_dev: Remove unnecessary ‘0’ values from err
Date: Sun, 22 Oct 2023 17:03:19 -0700	[thread overview]
Message-ID: <9d1b96a2-6709-819f-23aa-f91e9741a54d@roeck-us.net> (raw)
In-Reply-To: <20231021110538.441-1-fenghui@nfschina.com>

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@nfschina.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
         }



  reply	other threads:[~2023-10-23  0:04 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-21 11:05 [PATCH] watchdog_dev: Remove unnecessary ‘0’ values from err fenghui
2023-10-23  0:03 ` Guenter Roeck [this message]
2023-10-24 15:55 ` kernel test robot

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=9d1b96a2-6709-819f-23aa-f91e9741a54d@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=fenghui@nfschina.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-watchdog@vger.kernel.org \
    --cc=wim@linux-watchdog.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 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.