Skip to contentSkip to conversation

edac: Convert list_for_each to entry variant

PATCH In review Zou Wei 2 participants 2 messages Jun 15, 2021 – Jun 17, 2021 EDAC-core

lore
Share & tools
lore

Zou Wei

author
#0 lore raw

PATCH 1/1 edac: Convert list_for_each to entry variant

convert list_for_each() to list_for_each_entry() where applicable.

---
 drivers/edac/edac_device.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/edac/edac_device.c +1 -4
index 8c4d947..e8b33c3 100644
@@ -245,13 +245,10 @@ EXPORT_SYMBOL_GPL(edac_device_free_ctl_info);
 static struct edac_device_ctl_info *find_edac_device_by_dev(struct device *dev)
 {
 	struct edac_device_ctl_info *edac_dev;
-	struct list_head *item;
 
 	edac_dbg(0, "\n");
 
-	list_for_each(item, &edac_device_list) {
-		edac_dev = list_entry(item, struct edac_device_ctl_info, link);
-
+	list_for_each_entry(edac_dev, &edac_device_list, link) {
 		if (edac_dev->dev == dev)
 			return edac_dev;
 	}
Signature · 1 line
2.6.2
maintainer
#1 lore raw
Quoted 2 lines · Zou Wei

convert list_for_each() to list_for_each_entry() where applicable.

That conversion is applicable to one more place in that file...

Signature · 4 lines
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette