net: netfilter: remove unused variable
Subsystems (4)
PATCH 1/1 net: netfilter: remove unused variable
This patch uses the following coccinelle script to remove a variable that was simply used to store the return value of a function call before returning it:
@@
identifier len,f;
@@
-int len;
... when != len
when strict
-len =
+return
f(...);
-return len;
--- net/netfilter/ipvs/ip_vs_ftp.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
net/netfilter/ipvs/ip_vs_ftp.c +1 -3
@@ -482,11 +482,9 @@ static struct pernet_operations ip_vs_ftp_ops = {static int __init ip_vs_ftp_init (void ) { -int rv; - rv =register_pernet_subsys (&ip_vs_ftp_ops);/* rcu_barrier() is called by netns on error */ -return rv; +return register_pernet_subsys (&ip_vs_ftp_ops); }/*
Signature · 1 line
2.11.0
Quoted 26 lines · Arushi Singhal
This patch uses the following coccinelle script to remove a variable that was simply used to store the return value of a function call before returning it:
@@
identifier len,f;
@@(quoted diff) +1
-3-int len; ... when != len when strict -len = +return f(...); -return len;Signed-off-by Arushi Singhal <[email protected]>--- net/netfilter/ipvs/ip_vs_ftp.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)net/netfilter/ipvs/ip_vs_ftp.c +0
-0
net/netfilter/ipvs/ip_vs_ftp.c static struct pernet_operations ip_vs_ftp_ops = { · line 487
Quoted 9 lines
net/netfilter/ipvs/ip_vs_ftp.c +1
-3@@ -482,11 +482,9 @@ static struct pernet_operations ip_vs_ftp_ops = {static int __init ip_vs_ftp_init (void ) { -int rv; - rv =register_pernet_subsys (&ip_vs_ftp_ops);/* rcu_barrier() is called by netns on error */ -return rv; +return register_pernet_subsys (&ip_vs_ftp_ops);
It looks like you end up with an unnecessary blank line at the beginning of the function.
julia
Quoted 13 lines
net/netfilter/ipvs/ip_vs_ftp.c +0
-1}/* -- 2.11.0
--
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20170329133848.GA1336%40arushi-HP-Pavilion-Notebook.
For more options, visit https://groups.google.com/d/optout.