diff options
author | YueHaibing <yuehaibing@huawei.com> | 2018-12-10 19:25:38 +0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-12-10 11:55:05 -0800 |
commit | b1dd054dbb72551d42686862f935f96c3e2a53ea (patch) | |
tree | 4f05f8d47d93faabf6c070ed9a96e1326882006e /drivers/net/ipvlan/ipvlan_main.c | |
parent | c1c8c27701b8fcc0cbbe4af0f9304df466b0123e (diff) | |
download | linux-b1dd054dbb72551d42686862f935f96c3e2a53ea.tar.bz2 |
ipvlan: Remove a useless comparison
Fix following gcc warning:
drivers/net/ipvlan/ipvlan_main.c:543:12: warning:
comparison is always false due to limited range of data type [-Wtype-limits]
'mode' is a u16 variable, IPVLAN_MODE_L2 is zero,
the comparison is always false
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ipvlan/ipvlan_main.c')
-rw-r--r-- | drivers/net/ipvlan/ipvlan_main.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/ipvlan/ipvlan_main.c b/drivers/net/ipvlan/ipvlan_main.c index c3d3e458f541..723a3f663c06 100644 --- a/drivers/net/ipvlan/ipvlan_main.c +++ b/drivers/net/ipvlan/ipvlan_main.c @@ -540,7 +540,7 @@ static int ipvlan_nl_validate(struct nlattr *tb[], struct nlattr *data[], if (data[IFLA_IPVLAN_MODE]) { u16 mode = nla_get_u16(data[IFLA_IPVLAN_MODE]); - if (mode < IPVLAN_MODE_L2 || mode >= IPVLAN_MODE_MAX) + if (mode >= IPVLAN_MODE_MAX) return -EINVAL; } if (data[IFLA_IPVLAN_FLAGS]) { |