[PATCH net-next] qlcnic: Use list_for_each_entry() to simplify code in qlcnic_main.c

Subsystems: networking drivers, qlogic qlcnic (1/10)gb ethernet driver, the rest

STALE1890d

2 messages, 2 authors, 2021-06-16 · open the first message on its own page

[PATCH net-next] qlcnic: Use list_for_each_entry() to simplify code in qlcnic_main.c

From: Wang Hai <hidden>
Date: 2021-06-16 04:22:11

Convert list_for_each() to list_for_each_entry() where
applicable. This simplifies the code.

Reported-by: Hulk Robot <redacted>
Signed-off-by: Wang Hai <redacted>
---
 drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
index 96b947fde646..8a31ce29ecfc 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
@@ -319,10 +319,8 @@ int qlcnic_read_mac_addr(struct qlcnic_adapter *adapter)
 static void qlcnic_delete_adapter_mac(struct qlcnic_adapter *adapter)
 {
 	struct qlcnic_mac_vlan_list *cur;
-	struct list_head *head;
 
-	list_for_each(head, &adapter->mac_list) {
-		cur = list_entry(head, struct qlcnic_mac_vlan_list, list);
+	list_for_each_entry(cur, &adapter->mac_list, list) {
 		if (ether_addr_equal_unaligned(adapter->mac_addr, cur->mac_addr)) {
 			qlcnic_sre_macaddr_change(adapter, cur->mac_addr,
 						  0, QLCNIC_MAC_DEL);
-- 
2.17.1

Re: [PATCH net-next] qlcnic: Use list_for_each_entry() to simplify code in qlcnic_main.c

From: patchwork-bot+netdevbpf@kernel.org
Date: 2021-06-16 07:50:09

Hello:

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

On Wed, 16 Jun 2021 12:21:06 +0800 you wrote:
Convert list_for_each() to list_for_each_entry() where
applicable. This simplifies the code.

Reported-by: Hulk Robot <redacted>
Signed-off-by: Wang Hai <redacted>
---
 drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
Here is the summary with links:
  - [net-next] qlcnic: Use list_for_each_entry() to simplify code in qlcnic_main.c
    https://git.kernel.org/netdev/net-next/c/56b57b809f9c

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

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help