Skip to content

Commit

Permalink
bonding: use pre-defined macro in bond_mode_name instead of magic num…
Browse files Browse the repository at this point in the history
…ber 0

We have BOND_MODE_ROUNDROBIN pre-defined as 0, and it's the lowest
mode number.
Use it to check the arg lower bound instead of magic number 0 in
bond_mode_name.

Signed-off-by: Wang Sheng-Hui <shhuiw@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Wang Sheng-Hui authored and David S. Miller committed Jul 26, 2013
1 parent 9025c8e commit f528094
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/bonding/bond_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ const char *bond_mode_name(int mode)
[BOND_MODE_ALB] = "adaptive load balancing",
};

if (mode < 0 || mode > BOND_MODE_ALB)
if (mode < BOND_MODE_ROUNDROBIN || mode > BOND_MODE_ALB)
return "unknown";

return names[mode];
Expand Down

0 comments on commit f528094

Please sign in to comment.