Skip to contentSkip to conversation

wireless: Convert to list_for_each_entry_rcu()

PATCH In review Roel Kluin 1 participant 2 messages Feb 19, 2008 Networking drivers (wireless)

lore
Share & tools
lore

Roel Kluin

author
#0 lore raw

PATCH 1/1 wireless: Convert to list_for_each_entry_rcu()

Please verify, this patch was not yet tested.
---
Convert list_for_each_rcu() to list_for_each_entry_rcu()

---

drivers/net/wireless/strip.c +3 -2
index 88efe1b..c5aaab8 100644
@@ -963,11 +963,12 @@ static char *time_delta(char buffer[], long time)
 static struct strip *strip_get_idx(loff_t pos) 
 {
 	struct list_head *l;
+	struct strip *str;
 	int i = 0;
 
-	list_for_each_rcu(l, &strip_list) {
+	list_for_each_entry_rcu(str, l, &strip_list, list) {
 		if (pos == i)
-			return list_entry(l, struct strip, list);
+			return str;
 		++i;
 	}
 	return NULL;
author
#1 lore raw
Quoted 6 lines · Roel Kluin

Please verify, this patch was not yet tested.
---
Convert list_for_each_rcu() to list_for_each_entry_rcu()

---

Same mistake as in other patch, please ignore the previous patch and consider the patch below.
---
Convert list_for_each_rcu() to list_for_each_entry_rcu()

---

drivers/net/wireless/strip.c +3 -3
index 88efe1b..bced3fe 100644
@@ -962,12 +962,12 @@ static char *time_delta(char buffer[], long time)
 /* get Nth element of the linked list */
 static struct strip *strip_get_idx(loff_t pos) 
 {
-	struct list_head *l;
+	struct strip *str;
 	int i = 0;
 
-	list_for_each_rcu(l, &strip_list) {
+	list_for_each_entry_rcu(str, &strip_list, list) {
 		if (pos == i)
-			return list_entry(l, struct strip, list);
+			return str;
 		++i;
 	}
 	return NULL;