Skip to contentSkip to conversation

net: qede: Use list_for_each_entry() to simplify code

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

Subsystems (3)
lore
Share & tools
lore

Wang Hai

author
#0 lore raw

PATCH 1/1 net: qede: Use list_for_each_entry() to simplify code

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

---
 drivers/net/ethernet/qlogic/qede/qede_rdma.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/net/ethernet/qlogic/qede/qede_rdma.c +2 -4
index 2f6598086d9b..6304514a6f2c 100644
@@ -247,12 +247,10 @@ static struct qede_rdma_event_work *
 qede_rdma_get_free_event_node(struct qede_dev *edev)
 {
 	struct qede_rdma_event_work *event_node = NULL;
-	struct list_head *list_node = NULL;
 	bool found = false;
 
-	list_for_each(list_node, &edev->rdma_info.rdma_event_list) {
-		event_node = list_entry(list_node, struct qede_rdma_event_work,
-					list);
+	list_for_each_entry(event_node, &edev->rdma_info.rdma_event_list,
+			    list) {
 		if (!work_pending(&event_node->work)) {
 			found = true;
 			break;
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 Tue, 8 Jun 2021 07:57:37 +0000 you wrote:

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

---
 drivers/net/ethernet/qlogic/qede/qede_rdma.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

Here is the summary with links:
- [net-next] net: qede: Use list_for_each_entry() to simplify code

    https://git.kernel.org/netdev/net-next/c/36861d1f0408

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