Skip to content

Commit 403f072

Browse files
tklauserdavem330
authored andcommitted
vlan: Remove unnecessary comparison of unsigned against 0
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 <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 3f3177b commit 403f072

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

net/8021q/vlan.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -571,8 +571,7 @@ static int vlan_ioctl_handler(struct net *net, void __user *arg)
571571
err = -EPERM;
572572
if (!ns_capable(net->user_ns, CAP_NET_ADMIN))
573573
break;
574-
if ((args.u.name_type >= 0) &&
575-
(args.u.name_type < VLAN_NAME_TYPE_HIGHEST)) {
574+
if (args.u.name_type < VLAN_NAME_TYPE_HIGHEST) {
576575
struct vlan_net *vn;
577576

578577
vn = net_generic(net, vlan_net_id);

0 commit comments

Comments
 (0)