All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net] net: qede: Fix end of loop tests for list_for_each_entry
@ 2021-07-25 17:58 Harshvardhan Jha
  2021-07-25 22:10 ` patchwork-bot+netdevbpf
  0 siblings, 1 reply; 2+ messages in thread
From: Harshvardhan Jha @ 2021-07-25 17:58 UTC (permalink / raw)
  To: aelior
  Cc: GR-everest-linux-l2, davem, kuba, ast, daniel, hawk,
	john.fastabend, andrii, kafai, songliubraving, yhs, kpsingh,
	netdev, linux-kernel, bpf, Harshvardhan Jha

The list_for_each_entry() iterator, "vlan" in this code, can never be
NULL so the warning will never be printed.

Signed-off-by: Harshvardhan Jha <harshvardhan.jha@oracle.com>
---
From static analysis.  Not tested.
---
 drivers/net/ethernet/qlogic/qede/qede_filter.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/qlogic/qede/qede_filter.c b/drivers/net/ethernet/qlogic/qede/qede_filter.c
index c59b72c90293..a2e4dfb5cb44 100644
--- a/drivers/net/ethernet/qlogic/qede/qede_filter.c
+++ b/drivers/net/ethernet/qlogic/qede/qede_filter.c
@@ -831,7 +831,7 @@ int qede_configure_vlan_filters(struct qede_dev *edev)
 int qede_vlan_rx_kill_vid(struct net_device *dev, __be16 proto, u16 vid)
 {
 	struct qede_dev *edev = netdev_priv(dev);
-	struct qede_vlan *vlan = NULL;
+	struct qede_vlan *vlan;
 	int rc = 0;
 
 	DP_VERBOSE(edev, NETIF_MSG_IFDOWN, "Removing vlan 0x%04x\n", vid);
@@ -842,7 +842,7 @@ int qede_vlan_rx_kill_vid(struct net_device *dev, __be16 proto, u16 vid)
 		if (vlan->vid == vid)
 			break;
 
-	if (!vlan || (vlan->vid != vid)) {
+	if (list_entry_is_head(vlan, &edev->vlan_list, list)) {
 		DP_VERBOSE(edev, (NETIF_MSG_IFUP | NETIF_MSG_IFDOWN),
 			   "Vlan isn't configured\n");
 		goto out;
-- 
2.32.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH net] net: qede: Fix end of loop tests for list_for_each_entry
  2021-07-25 17:58 [PATCH net] net: qede: Fix end of loop tests for list_for_each_entry Harshvardhan Jha
@ 2021-07-25 22:10 ` patchwork-bot+netdevbpf
  0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-07-25 22:10 UTC (permalink / raw)
  To: Harshvardhan Jha
  Cc: aelior, GR-everest-linux-l2, davem, kuba, ast, daniel, hawk,
	john.fastabend, andrii, kafai, songliubraving, yhs, kpsingh,
	netdev, linux-kernel, bpf

Hello:

This patch was applied to netdev/net.git (refs/heads/master):

On Sun, 25 Jul 2021 23:28:04 +0530 you wrote:
> The list_for_each_entry() iterator, "vlan" in this code, can never be
> NULL so the warning will never be printed.
> 
> Signed-off-by: Harshvardhan Jha <harshvardhan.jha@oracle.com>
> ---
> From static analysis.  Not tested.
> 
> [...]

Here is the summary with links:
  - [net] net: qede: Fix end of loop tests for list_for_each_entry
    https://git.kernel.org/netdev/net/c/795e3d2ea68e

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-07-25 22:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-25 17:58 [PATCH net] net: qede: Fix end of loop tests for list_for_each_entry Harshvardhan Jha
2021-07-25 22:10 ` patchwork-bot+netdevbpf

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.