From 0965a1f3f8757a2c20a16a83bc18279009d79a26 Mon Sep 17 00:00:00 2001 From: Veaceslav Falico Date: Wed, 25 Sep 2013 09:20:21 +0200 Subject: bonding: add bond_has_slaves() and use it Currently we verify if we have slaves by checking if bond->slave_list is empty. Create a define bond_has_slaves() and use it, a bit more readable and easier to change in the future. CC: Jay Vosburgh CC: Andy Gospodarek Signed-off-by: Veaceslav Falico Signed-off-by: David S. Miller --- drivers/net/bonding/bonding.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'drivers/net/bonding/bonding.h') diff --git a/drivers/net/bonding/bonding.h b/drivers/net/bonding/bonding.h index 7c8a4b128f65..bcef15ec3459 100644 --- a/drivers/net/bonding/bonding.h +++ b/drivers/net/bonding/bonding.h @@ -72,6 +72,8 @@ res; }) /* slave list primitives */ +#define bond_has_slaves(bond) !list_empty(&(bond)->slave_list) + #define bond_to_slave(ptr) list_entry(ptr, struct slave, list) /* IMPORTANT: bond_first/last_slave can return NULL in case of an empty list */ -- cgit v1.2.3