Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <tklauser@distanz.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Tobias Klauser and committed by
David S. Miller
403f0727 3f3177bb

+1 -2
+1 -2
net/8021q/vlan.c
··· 571 571 err = -EPERM; 572 572 if (!ns_capable(net->user_ns, CAP_NET_ADMIN)) 573 573 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) { 576 575 struct vlan_net *vn; 577 576 578 577 vn = net_generic(net, vlan_net_id);