[PATCH 06/13] EDAC: Use list_add_(before|after) macros
From: Ken Helias
Date: Fri Jun 06 2014 - 13:34:58 EST
From: Ken Helias <kenhelias@xxxxxxxxxxx>
Many places in the code uses list_add_tail/list_add to insert an entry
before/after another entry. This confuses the reader because these are usually
used to add an item to a list_head and not an entry. Better use the self
explaining function name.
Signed-off-by: Ken Helias <kenhelias@xxxxxxxxxxx>
Cc: linux-edac@xxxxxxxxxxxxxxx
---
drivers/edac/edac_device.c | 2 +-
drivers/edac/edac_mc.c | 2 +-
drivers/edac/edac_pci.c | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/edac/edac_device.c b/drivers/edac/edac_device.c
index 592af5f..b9216b2 100644
--- a/drivers/edac/edac_device.c
+++ b/drivers/edac/edac_device.c
@@ -318,7 +318,7 @@ static int add_edac_dev_to_global_list(struct edac_device_ctl_info *edac_dev)
}
}
- list_add_tail_rcu(&edac_dev->link, insert_before);
+ list_add_before_rcu(&edac_dev->link, insert_before);
return 0;
fail0:
diff --git a/drivers/edac/edac_mc.c b/drivers/edac/edac_mc.c
index 2c694b5..ef4d653 100644
--- a/drivers/edac/edac_mc.c
+++ b/drivers/edac/edac_mc.c
@@ -653,7 +653,7 @@ static int add_mc_to_global_list(struct mem_ctl_info *mci)
}
}
- list_add_tail_rcu(&mci->link, insert_before);
+ list_add_before_rcu(&mci->link, insert_before);
atomic_inc(&edac_handlers);
return 0;
diff --git a/drivers/edac/edac_pci.c b/drivers/edac/edac_pci.c
index 2cf44b4d..df6c69b 100644
--- a/drivers/edac/edac_pci.c
+++ b/drivers/edac/edac_pci.c
@@ -144,7 +144,7 @@ static int add_edac_pci_to_global_list(struct edac_pci_ctl_info *pci)
}
}
- list_add_tail_rcu(&pci->link, insert_before);
+ list_add_before_rcu(&pci->link, insert_before);
return 0;
fail0:
--
2.0.0
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/