mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Martin Habets <martin.habets@xilinx.com>
To: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
Cc: <ecree.xilinx@gmail.com>, <habetsm.xilinx@gmail.com>,
	<davem@davemloft.net>, <kuba@kernel.org>, <ast@kernel.org>,
	<daniel@iogearbox.net>, <hawk@kernel.org>,
	<john.fastabend@gmail.com>, <netdev@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>, <bpf@vger.kernel.org>,
	Abaci Robot <abaci@linux.alibaba.com>
Subject: Re: [PATCH] sfc: Fix missing error code in efx_reset_up()
Date: Fri, 14 Jan 2022 09:41:47 +0000	[thread overview]
Message-ID: <20220114094147.GA52632@xcbmartinh41x.xilinx.com> (raw)
In-Reply-To: <20220113161315.126410-1-jiapeng.chong@linux.alibaba.com>

On Fri, Jan 14, 2022 at 12:13:15AM +0800, Jiapeng Chong wrote:
> The error code is missing in this code scenario, add the error code
> '-EINVAL' to the return value 'rc'.
> 
> Eliminate the follow smatch warning:
> 
> drivers/net/ethernet/sfc/efx_common.c:758 efx_reset_up() warn: missing
> error code 'rc'.

The warning is not correct. We want to return an rc of 0 in this case, and
that is what rc is already set to given the earlier code.

Martin

> 
> Reported-by: Abaci Robot <abaci@linux.alibaba.com>
> Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
> ---
>  drivers/net/ethernet/sfc/efx_common.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/sfc/efx_common.c b/drivers/net/ethernet/sfc/efx_common.c
> index af37c990217e..bdfcda8bb5d0 100644
> --- a/drivers/net/ethernet/sfc/efx_common.c
> +++ b/drivers/net/ethernet/sfc/efx_common.c
> @@ -754,8 +754,10 @@ int efx_reset_up(struct efx_nic *efx, enum reset_type method, bool ok)
>  		goto fail;
>  	}
>  
> -	if (!ok)
> +	if (!ok) {
> +		rc = -EINVAL;
>  		goto fail;
> +	}
>  
>  	if (efx->port_initialized && method != RESET_TYPE_INVISIBLE &&
>  	    method != RESET_TYPE_DATAPATH) {
> -- 
> 2.20.1.7.g153144c

      reply	other threads:[~2022-01-14  9:41 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-13 16:13 Jiapeng Chong
2022-01-14  9:41 ` Martin Habets [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=20220114094147.GA52632@xcbmartinh41x.xilinx.com \
    --to=martin.habets@xilinx.com \
    --cc=abaci@linux.alibaba.com \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=ecree.xilinx@gmail.com \
    --cc=habetsm.xilinx@gmail.com \
    --cc=hawk@kernel.org \
    --cc=jiapeng.chong@linux.alibaba.com \
    --cc=john.fastabend@gmail.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.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

all inboxes | Powered by JetHome®