Skip to contentSkip to conversation

bonding: Simplify __get_duplex function.

PATCH In review Mahesh Bandewar 1 participant 1 message Oct 31, 2015

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/3 bonding: Simplify __get_duplex function.

Eliminate 'else' clause by simply initializing variable

---
 drivers/net/bonding/bond_3ad.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/net/bonding/bond_3ad.c +2 -4
index 3c45358844eb..3a17fd207ec6 100644
@@ -327,14 +327,12 @@ static u16 __get_link_speed(struct port *port)
 static u8 __get_duplex(struct port *port)
 {
 	struct slave *slave = port->slave;
-	u8 retval;
+	u8 retval = 0x0;
 
 	/* handling a special case: when the configuration starts with
 	 * link down, it sets the duplex to 0.
 	 */
-	if (slave->link != BOND_LINK_UP) {
-		retval = 0x0;
-	} else {
+	if (slave->link == BOND_LINK_UP) {
 		switch (slave->duplex) {
 		case DUPLEX_FULL:
 			retval = 0x1;
Signature · 1 line
2.6.0.rc2.230.g3dd15c0