Skip to contentSkip to conversation

qlcnic: Use list_for_each_entry() to simplify code in qlcnic_main.c

PATCH Applied Wang Hai 2 participants 2 messages Jun 16, 2021

Subsystems (3)
lore
Share & tools
lore

Wang Hai

author
#0 lore raw

PATCH 1/1 qlcnic: Use list_for_each_entry() to simplify code in qlcnic_main.c

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

---
 drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c +1 -3
index 96b947fde646..8a31ce29ecfc 100644
@@ -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);
Signature · 1 line
2.17.1
#1 lore raw
This patch was applied to netdev/net-next.git (refs/heads/master):

Hello:

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

Quoted 8 lines · 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.

---
 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