projects
/
platform
/
kernel
/
linux-rpi3.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7cafb0b
)
net: vlan: Use sizeof instead of literal number
author
Gao Feng
<fgao@ikuai8.com>
Tue, 18 Oct 2016 00:57:50 +0000
(08:57 +0800)
committer
David S. Miller
<davem@davemloft.net>
Tue, 18 Oct 2016 18:23:23 +0000
(14:23 -0400)
Use sizeof variable instead of literal number to enhance the readability.
Signed-off-by: Gao Feng <fgao@ikuai8.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/8021q/vlan.c
patch
|
blob
|
history
diff --git
a/net/8021q/vlan.c
b/net/8021q/vlan.c
index
f8903c1
..
9accde3
100644
(file)
--- a/
net/8021q/vlan.c
+++ b/
net/8021q/vlan.c
@@
-515,8
+515,8
@@
static int vlan_ioctl_handler(struct net *net, void __user *arg)
return -EFAULT;
/* Null terminate this sucker, just in case. */
- args.device1[
23
] = 0;
- args.u.device2[
23
] = 0;
+ args.device1[
sizeof(args.device1) - 1
] = 0;
+ args.u.device2[
sizeof(args.u.device2) - 1
] = 0;
rtnl_lock();