netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Simon Horman <horms@kernel.org>
To: Colin Ian King <colin.i.king@gmail.com>
Cc: Manish Chopra <manishc@marvell.com>,
	Rahul Verma <rahulv@marvell.com>,
	GR-Linux-NIC-Dev@marvell.com,
	"David S . Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	netdev@vger.kernel.org, kernel-janitors@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH][next] netxen_nic: remove redundant assignment to variable capability
Date: Wed, 7 Feb 2024 09:46:09 +0000	[thread overview]
Message-ID: <20240207094609.GN1104779@kernel.org> (raw)
In-Reply-To: <20240206115049.1879389-1-colin.i.king@gmail.com>

On Tue, Feb 06, 2024 at 11:50:49AM +0000, Colin Ian King wrote:
> The variable capability is being assigned a value that is never
> read and is being re-assigned later. The assignment is redundant and
> can be removed. Also remove empty line before assignment to capability.
> 
> Cleans up clang scan build warning:
> drivers/net/ethernet/qlogic/netxen/netxen_nic_init.c:1189:2: warning:
> Value stored to 'capability' is never read [deadcode.DeadStores]
> 
> Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
> ---
>  drivers/net/ethernet/qlogic/netxen/netxen_nic_init.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/drivers/net/ethernet/qlogic/netxen/netxen_nic_init.c b/drivers/net/ethernet/qlogic/netxen/netxen_nic_init.c
> index 35ec9aab3dc7..51fa880eaf6c 100644
> --- a/drivers/net/ethernet/qlogic/netxen/netxen_nic_init.c
> +++ b/drivers/net/ethernet/qlogic/netxen/netxen_nic_init.c
> @@ -1186,7 +1186,6 @@ static int
>  netxen_p3_has_mn(struct netxen_adapter *adapter)
>  {
>  	u32 capability, flashed_ver;
> -	capability = 0;

This part looks correct :)

>  
>  	/* NX2031 always had MN */
>  	if (NX_IS_REVISION_P2(adapter->ahw.revision_id))
> @@ -1197,7 +1196,6 @@ netxen_p3_has_mn(struct netxen_adapter *adapter)
>  	flashed_ver = NETXEN_DECODE_VERSION(flashed_ver);
>  
>  	if (flashed_ver >= NETXEN_VERSION_CODE(4, 0, 220)) {
> -

This part doesn't seem strictly related to the patch description.
But in looking at it more closely, I wonder if it would be good
to reduce the scope of capability to this context (and leave the bank
line).

>  		capability = NXRD32(adapter, NX_PEG_TUNE_CAPABILITY);
>  		if (capability & NX_PEG_TUNE_MN_PRESENT)
>  			return 1;

In any case, I agree that this patch is correct, and I'm happy with
it with or without the change I suggested above.

Reviewed-by: Simon Horman <horms@kernel.org>


  reply	other threads:[~2024-02-07  9:46 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-06 11:50 [PATCH][next] netxen_nic: remove redundant assignment to variable capability Colin Ian King
2024-02-07  9:46 ` Simon Horman [this message]
2024-02-09  3:11 ` patchwork-bot+netdevbpf

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=20240207094609.GN1104779@kernel.org \
    --to=horms@kernel.org \
    --cc=GR-Linux-NIC-Dev@marvell.com \
    --cc=colin.i.king@gmail.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=manishc@marvell.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=rahulv@marvell.com \
    /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).