summaryrefslogtreecommitdiffstats
path: root/drivers/fpga
diff options
context:
space:
mode:
authorMoritz Fischer <mdf@kernel.org>2017-03-10 12:47:11 -0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-03-17 15:10:48 +0900
commitc37235cce31d5e03b73692f31e994964f18e2dc2 (patch)
tree4c7304e86b6d6cb0e1e3f63717a0c3cdbee8f156 /drivers/fpga
parent21f8ba2ef378d906374a26f7abc05fb92219e9c6 (diff)
downloadlinux-c37235cce31d5e03b73692f31e994964f18e2dc2.tar.gz
linux-c37235cce31d5e03b73692f31e994964f18e2dc2.tar.bz2
linux-c37235cce31d5e03b73692f31e994964f18e2dc2.zip
fpga: bridge: Replace open-coded list_for_each + list_entry
Replaces open-coded list_for_each() + list_entry() with macro list_for_each_entry() Signed-off-by: Moritz Fischer <mdf@kernel.org> Cc: linux-fpga@vger.kernel.org Cc: linux-kernel@vger.kernel.org Acked-by: Alan Tull <atull@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/fpga')
-rw-r--r--drivers/fpga/fpga-bridge.c15
1 files changed, 4 insertions, 11 deletions
diff --git a/drivers/fpga/fpga-bridge.c b/drivers/fpga/fpga-bridge.c
index e04a899d1a90..9651aa56244a 100644
--- a/drivers/fpga/fpga-bridge.c
+++ b/drivers/fpga/fpga-bridge.c
@@ -146,11 +146,9 @@ EXPORT_SYMBOL_GPL(fpga_bridge_put);
int fpga_bridges_enable(struct list_head *bridge_list)
{
struct fpga_bridge *bridge;
- struct list_head *node;
int ret;
- list_for_each(node, bridge_list) {
- bridge = list_entry(node, struct fpga_bridge, node);
+ list_for_each_entry(bridge, bridge_list, node) {
ret = fpga_bridge_enable(bridge);
if (ret)
return ret;
@@ -172,11 +170,9 @@ EXPORT_SYMBOL_GPL(fpga_bridges_enable);
int fpga_bridges_disable(struct list_head *bridge_list)
{
struct fpga_bridge *bridge;
- struct list_head *node;
int ret;
- list_for_each(node, bridge_list) {
- bridge = list_entry(node, struct fpga_bridge, node);
+ list_for_each_entry(bridge, bridge_list, node) {
ret = fpga_bridge_disable(bridge);
if (ret)
return ret;
@@ -196,13 +192,10 @@ EXPORT_SYMBOL_GPL(fpga_bridges_disable);
*/
void fpga_bridges_put(struct list_head *bridge_list)
{
- struct fpga_bridge *bridge;
- struct list_head *node, *next;
+ struct fpga_bridge *bridge, *next;
unsigned long flags;
- list_for_each_safe(node, next, bridge_list) {
- bridge = list_entry(node, struct fpga_bridge, node);
-
+ list_for_each_entry_safe(bridge, next, bridge_list, node) {
fpga_bridge_put(bridge);
spin_lock_irqsave(&bridge_list_lock, flags);