diff options
author | Wang Sheng-Hui <shhuiw@gmail.com> | 2013-07-24 08:53:26 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-07-26 22:53:49 +0200 |
commit | f52809483caceaf83bd2c7915a35ace3b6e7b0ef (patch) | |
tree | 5083d205c337825a85051872e6cb6cba574d7c15 /drivers | |
parent | drivers/net/ethernet/stmicro/stmmac: don't check resource with devm_ioremap_r... (diff) | |
download | linux-f52809483caceaf83bd2c7915a35ace3b6e7b0ef.tar.xz linux-f52809483caceaf83bd2c7915a35ace3b6e7b0ef.zip |
bonding: use pre-defined macro in bond_mode_name instead of magic number 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>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/bonding/bond_main.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index 414d07ef6540..fc10c12bb304 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c @@ -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]; |