All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jacob Keller <jacob.e.keller@intel.com>
To: "Ваторопин Андрей" <a.vatoropin@crpt.ru>,
	"Tariq Toukan" <tariqt@nvidia.com>
Cc: Andrew Lunn <andrew+netdev@lunn.ch>,
	"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" <netdev@vger.kernel.org>,
	"linux-rdma@vger.kernel.org" <linux-rdma@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"lvc-project@linuxtesting.org" <lvc-project@linuxtesting.org>
Subject: Re: [PATCH net-next] net/mlx4_en: Remove the redundant NULL check for the 'my_ets' object
Date: Mon, 16 Jun 2025 15:11:34 -0700	[thread overview]
Message-ID: <4e3e501e-d89b-4eec-afa1-3ec78d5a6527@intel.com> (raw)
In-Reply-To: <20250616045034.26000-1-a.vatoropin@crpt.ru>



On 6/15/2025 9:50 PM, Ваторопин Андрей wrote:
> From: Andrey Vatoropin <a.vatoropin@crpt.ru>
> 
> Static analysis shows that pointer "my_ets" cannot be NULL because it 
> points to the object "struct ieee_ets".
> 
> Remove the extra NULL check. It is meaningless and harms the readability
> of the code.
> 
> Found by Linux Verification Center (linuxtesting.org) with SVACE.
> 
> Signed-off-by: Andrey Vatoropin <a.vatoropin@crpt.ru>
> Reviewed-by: Tariq Toukan <tariqt@nvidia.com>
> ---
> Resend for net-next. Link to initial thread:
> https://lore.kernel.org/netdev/20250401061439.9978-1-a.vatoropin@crpt.ru/
>  drivers/net/ethernet/mellanox/mlx4/en_dcb_nl.c | 3 ---
>  1 file changed, 3 deletions(-)
> 
> diff --git a/drivers/net/ethernet/mellanox/mlx4/en_dcb_nl.c b/drivers/net/ethernet/mellanox/mlx4/en_dcb_nl.c
> index 752a72499b4f..be80da03a594 100644
> --- a/drivers/net/ethernet/mellanox/mlx4/en_dcb_nl.c
> +++ b/drivers/net/ethernet/mellanox/mlx4/en_dcb_nl.c
> @@ -290,9 +290,6 @@ static int mlx4_en_dcbnl_ieee_getets(struct net_device *dev,
>  	struct mlx4_en_priv *priv = netdev_priv(dev);
>  	struct ieee_ets *my_ets = &priv->ets;
>  
> -	if (!my_ets)
> -		return -EINVAL;
> -
>  	ets->ets_cap = IEEE_8021QAZ_MAX_TCS;
>  	ets->cbs = my_ets->cbs;
>  	memcpy(ets->tc_tx_bw, my_ets->tc_tx_bw, sizeof(ets->tc_tx_bw));

Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>

  reply	other threads:[~2025-06-16 22:12 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-16  4:50 [PATCH net-next] net/mlx4_en: Remove the redundant NULL check for the 'my_ets' object Ваторопин Андрей
2025-06-16 22:11 ` Jacob Keller [this message]
2025-06-19 10:10 ` 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=4e3e501e-d89b-4eec-afa1-3ec78d5a6527@intel.com \
    --to=jacob.e.keller@intel.com \
    --cc=a.vatoropin@crpt.ru \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=lvc-project@linuxtesting.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=tariqt@nvidia.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 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.