Skip to content

Commit b1dd054

Browse files
YueHaibingdavem330
authored andcommitted
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 <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent c1c8c27 commit b1dd054

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/net/ipvlan/ipvlan_main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -540,7 +540,7 @@ static int ipvlan_nl_validate(struct nlattr *tb[], struct nlattr *data[],
540540
if (data[IFLA_IPVLAN_MODE]) {
541541
u16 mode = nla_get_u16(data[IFLA_IPVLAN_MODE]);
542542

543-
if (mode < IPVLAN_MODE_L2 || mode >= IPVLAN_MODE_MAX)
543+
if (mode >= IPVLAN_MODE_MAX)
544544
return -EINVAL;
545545
}
546546
if (data[IFLA_IPVLAN_FLAGS]) {

0 commit comments

Comments
 (0)