Skip to content

Commit b25c2e7

Browse files
Mahesh Bandewardavem330
authored andcommitted
bonding: Simplify __get_duplex function.
Eliminate 'else' clause by simply initializing variable Signed-off-by: Mahesh Bandewar <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 12d4309 commit b25c2e7

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

drivers/net/bonding/bond_3ad.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -327,14 +327,12 @@ static u16 __get_link_speed(struct port *port)
327327
static u8 __get_duplex(struct port *port)
328328
{
329329
struct slave *slave = port->slave;
330-
u8 retval;
330+
u8 retval = 0x0;
331331

332332
/* handling a special case: when the configuration starts with
333333
* link down, it sets the duplex to 0.
334334
*/
335-
if (slave->link != BOND_LINK_UP) {
336-
retval = 0x0;
337-
} else {
335+
if (slave->link == BOND_LINK_UP) {
338336
switch (slave->duplex) {
339337
case DUPLEX_FULL:
340338
retval = 0x1;

0 commit comments

Comments
 (0)