linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Heiner Kallweit <hkallweit1@gmail.com>
To: cgel.zte@gmail.com, rajur@chelsio.com
Cc: davem@davemloft.net, kuba@kernel.org, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Chi Minghao <chi.minghao@zte.com.cn>,
	Zeal Robot <zealci@zte.com.cn>
Subject: Re: [PATCH] cxgb4: remove unneeded variable
Date: Tue, 31 Aug 2021 10:07:46 +0200	[thread overview]
Message-ID: <90c48d79-29e5-ec9e-273d-5598fc4f5fab@gmail.com> (raw)
In-Reply-To: <20210831062255.13113-1-chi.minghao@zte.com.cn>

On 31.08.2021 08:22, cgel.zte@gmail.com wrote:
> From: Chi Minghao <chi.minghao@zte.com.cn>
> 
> Fix the following coccicheck REVIEW:
> ./drivers/net/ethernet/chelsio/cxgb4/t4_hw.c:3266:5-8 REVIEW Unneeded
> variable
> 
> Reported-by: Zeal Robot <zealci@zte.com.cn>
> Signed-off-by: Chi Minghao <chi.minghao@zte.com.cn>

This patch is simply wrong and obviously not even compile-tested.
You would have found out by looking 5s at the code of the function.
Look at what the FIRST_RET macro is doing.
Please don't blindly trust tools and check patches proposed by tools.

> ---
>  drivers/net/ethernet/chelsio/cxgb4/t4_hw.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c b/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c
> index 5e8ac42ac6ab..c986a414414b 100644
> --- a/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c
> +++ b/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c
> @@ -3263,8 +3263,6 @@ int t4_get_scfg_version(struct adapter *adapter, u32 *vers)
>   */
>  int t4_get_version_info(struct adapter *adapter)
>  {
> -	int ret = 0;
> -
>  	#define FIRST_RET(__getvinfo) \
>  	do { \
>  		int __ret = __getvinfo; \
> @@ -3280,7 +3278,7 @@ int t4_get_version_info(struct adapter *adapter)
>  	FIRST_RET(t4_get_vpd_version(adapter, &adapter->params.vpd_vers));
>  
>  	#undef FIRST_RET
> -	return ret;
> +	return 0;
>  }
>  
>  /**
> 


  reply	other threads:[~2021-08-31  8:08 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-31  6:22 [PATCH] cxgb4: remove unneeded variable cgel.zte
2021-08-31  8:07 ` Heiner Kallweit [this message]
2021-08-31 16:47 ` kernel test robot
2021-09-01  9:35 ` 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=90c48d79-29e5-ec9e-273d-5598fc4f5fab@gmail.com \
    --to=hkallweit1@gmail.com \
    --cc=cgel.zte@gmail.com \
    --cc=chi.minghao@zte.com.cn \
    --cc=davem@davemloft.net \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=rajur@chelsio.com \
    --cc=zealci@zte.com.cn \
    /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;
as well as URLs for NNTP newsgroup(s).