Skip to contentSkip to conversation

net/8021q: beautify code, name_type is unsigned int, always >= 0

PATCH New Chen Gang 1 participant 1 message Feb 28, 2013

Subsystems (2)
lore
Share & tools
lore

Chen Gang

author
#0 lore raw

PATCH 1/1 net/8021q: beautify code, name_type is unsigned int, always >= 0

args.u.name_type is unsigned int, which is always >= 0

---
 net/8021q/vlan.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
net/8021q/vlan.c +1 -2
index a187144..0f5261a 100644
@@ -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);
Signature · 1 line
1.7.7.6