All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] net: netfilter: remove unused variable
@ 2017-03-29 13:38 Arushi Singhal
  2017-03-29 14:16 ` [Outreachy kernel] " Julia Lawall
  0 siblings, 1 reply; 2+ messages in thread
From: Arushi Singhal @ 2017-03-29 13:38 UTC (permalink / raw)
  To: outreachy-kernel
  Cc: Wensong Zhang, Simon Horman, Julian Anastasov, Pablo Neira Ayuso,
	Jozsef Kadlecsik, David S. Miller, netdev, lvs-devel,
	netfilter-devel, coreteam, linux-kernel

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;

Signed-off-by: Arushi Singhal <arushisinghal19971997@gmail.com>
---
 net/netfilter/ipvs/ip_vs_ftp.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/net/netfilter/ipvs/ip_vs_ftp.c b/net/netfilter/ipvs/ip_vs_ftp.c
index d30c327bb578..9e1e682610ef 100644
--- a/net/netfilter/ipvs/ip_vs_ftp.c
+++ b/net/netfilter/ipvs/ip_vs_ftp.c
@@ -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);
 }
 
 /*
-- 
2.11.0



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [Outreachy kernel] [PATCH] net: netfilter: remove unused variable
  2017-03-29 13:38 [PATCH] net: netfilter: remove unused variable Arushi Singhal
@ 2017-03-29 14:16 ` Julia Lawall
  0 siblings, 0 replies; 2+ messages in thread
From: Julia Lawall @ 2017-03-29 14:16 UTC (permalink / raw)
  To: Arushi Singhal
  Cc: outreachy-kernel, Wensong Zhang, Simon Horman, Julian Anastasov,
	Pablo Neira Ayuso, Jozsef Kadlecsik, David S. Miller, netdev,
	lvs-devel, netfilter-devel, coreteam, linux-kernel



On Wed, 29 Mar 2017, Arushi Singhal wrote:

> 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;
>
> Signed-off-by: Arushi Singhal <arushisinghal19971997@gmail.com>
> ---
>  net/netfilter/ipvs/ip_vs_ftp.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/net/netfilter/ipvs/ip_vs_ftp.c b/net/netfilter/ipvs/ip_vs_ftp.c
> index d30c327bb578..9e1e682610ef 100644
> --- a/net/netfilter/ipvs/ip_vs_ftp.c
> +++ b/net/netfilter/ipvs/ip_vs_ftp.c
> @@ -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

>  }
>
>  /*
> --
> 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 outreachy-kernel+unsubscribe@googlegroups.com.
> To post to this group, send email to outreachy-kernel@googlegroups.com.
> 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.
>


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-03-29 14:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-29 13:38 [PATCH] net: netfilter: remove unused variable Arushi Singhal
2017-03-29 14:16 ` [Outreachy kernel] " Julia Lawall

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.