Skip to content

Commit

Permalink
vlan: Remove unnecessary comparison of unsigned against 0
Browse files Browse the repository at this point in the history
args.u.name_type is of type unsigned int and is always >= 0.

This fixes the following GCC warning:

  net/8021q/vlan.c: In function ‘vlan_ioctl_handler’:
  net/8021q/vlan.c:574:14: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Tobias Klauser authored and David S. Miller committed Oct 18, 2016
1 parent 3f3177b commit 403f072
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions net/8021q/vlan.c
Original file line number Diff line number Diff line change
Expand Up @@ -571,8 +571,7 @@ static int vlan_ioctl_handler(struct net *net, void __user *arg)
err = -EPERM;
if (!ns_capable(net->user_ns, CAP_NET_ADMIN))
break;
if ((args.u.name_type >= 0) &&
(args.u.name_type < VLAN_NAME_TYPE_HIGHEST)) {
if (args.u.name_type < VLAN_NAME_TYPE_HIGHEST) {
struct vlan_net *vn;

vn = net_generic(net, vlan_net_id);
Expand Down

0 comments on commit 403f072

Please sign in to comment.