From 8cc211a153e11a11ecda4aeb7aa5514ac1af82f1 Mon Sep 17 00:00:00 2001 From: Jianhua Xie Date: Tue, 22 Apr 2014 09:17:49 +0800 Subject: bonding: make LAG codes to fit different kernel Linux kernel API bond_for_each_slave of bonding.h has different params along with different kernel version as below table: Older version: bond_for_each_slave(bond, pos, int cnt), 3.11.0-rc1(dec1e90e8): bond_for_each_slave(bond, pos), 3.12.0-rc1(9caff1e7b): bond_for_each_slave(bond, slave, list_head *iter) This patch is making LAG codes to fit different kernel version. Signed-off-by: Jianhua Xie Change-Id: Ifd365cd232aba67a437b156568d88c6e16c44c1a Reviewed-on: http://git.am.freescale.net:8181/11293 Reviewed-by: Dongsheng Wang Tested-by: Review Code-CDREVIEW Reviewed-by: Jiafei Pan Reviewed-by: Scott Wood diff --git a/drivers/net/bonding/hw_distribution.c b/drivers/net/bonding/hw_distribution.c index 1403659..e87d016 100644 --- a/drivers/net/bonding/hw_distribution.c +++ b/drivers/net/bonding/hw_distribution.c @@ -348,10 +348,9 @@ static bool is_dpa_eth_port(struct net_device *netdev) bool are_all_slaves_linkup(struct bonding *bond) { struct slave *slave; - struct list_head *iter; read_lock(&bond->lock); - bond_for_each_slave(bond, slave, iter) + bond_for_each_slave(bond, slave) if (!(SLAVE_IS_OK(slave))) { read_unlock(&bond->lock); return false; -- cgit v0.10.2