All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] netfilter: ,netdev@vger.kernel.org
@ 2017-03-21 13:23 simran singhal
  2017-03-21 13:23 ` [PATCH 1/2] netfilter: ipset: Compress return logic simran singhal
  2017-03-21 13:23 ` [PATCH 2/2] netfilter: ipvs: " simran singhal
  0 siblings, 2 replies; 4+ messages in thread
From: simran singhal @ 2017-03-21 13:23 UTC (permalink / raw)
  To: pablo
  Cc: kadlec, davem, netfilter-devel, coreteam, netdev, linux-kernel,
	gregkh, outreachy-kernel, wensong, horms, ja

This patch series Simplify function returns by merging 
assignment and return into one command line.

simran singhal (2):
  netfilter: ipset: Compress return logic
  netfilter: ipvs: Compress return logic

 net/netfilter/ipset/ip_set_list_set.c | 5 +----
 net/netfilter/ipvs/ip_vs_ftp.c        | 5 +----
 2 files changed, 2 insertions(+), 8 deletions(-)

-- 
2.7.4



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

* [PATCH 1/2] netfilter: ipset: Compress return logic
  2017-03-21 13:23 [PATCH 0/2] netfilter: ,netdev@vger.kernel.org simran singhal
@ 2017-03-21 13:23 ` simran singhal
  2017-03-21 13:23 ` [PATCH 2/2] netfilter: ipvs: " simran singhal
  1 sibling, 0 replies; 4+ messages in thread
From: simran singhal @ 2017-03-21 13:23 UTC (permalink / raw)
  To: pablo
  Cc: kadlec, davem, netfilter-devel, coreteam, netdev, linux-kernel,
	gregkh, outreachy-kernel, wensong, horms, ja

Simplify function returns by merging assignment and return into one
command line.

Signed-off-by: simran singhal <singhalsimran0@gmail.com>
---
 
 --This is my contribution to the netfilter project of
   Outreachy Round 14.

 net/netfilter/ipset/ip_set_list_set.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/net/netfilter/ipset/ip_set_list_set.c b/net/netfilter/ipset/ip_set_list_set.c
index 178d4eb..2fff6b5 100644
--- a/net/netfilter/ipset/ip_set_list_set.c
+++ b/net/netfilter/ipset/ip_set_list_set.c
@@ -453,7 +453,6 @@ static size_t
 list_set_memsize(const struct list_set *map, size_t dsize)
 {
 	struct set_elem *e;
-	size_t memsize;
 	u32 n = 0;
 
 	rcu_read_lock();
@@ -461,9 +460,7 @@ list_set_memsize(const struct list_set *map, size_t dsize)
 		n++;
 	rcu_read_unlock();
 
-	memsize = sizeof(*map) + n * dsize;
-
-	return memsize;
+	return (sizeof(*map) + n * dsize);
 }
 
 static int
-- 
2.7.4



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

* [PATCH 2/2] netfilter: ipvs: Compress return logic
  2017-03-21 13:23 [PATCH 0/2] netfilter: ,netdev@vger.kernel.org simran singhal
  2017-03-21 13:23 ` [PATCH 1/2] netfilter: ipset: Compress return logic simran singhal
@ 2017-03-21 13:23 ` simran singhal
  2017-03-21 15:49   ` Sergei Shtylyov
  1 sibling, 1 reply; 4+ messages in thread
From: simran singhal @ 2017-03-21 13:23 UTC (permalink / raw)
  To: pablo
  Cc: kadlec, davem, netfilter-devel, coreteam, netdev, linux-kernel,
	gregkh, outreachy-kernel, wensong, horms, ja

Simplify function returns by merging assignment and return into
one command line.

Signed-off-by: simran singhal <singhalsimran0@gmail.com>
---

 --This is my contribution to the netfilter project of
   Outreachy Round 14.

 net/netfilter/ipvs/ip_vs_ftp.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/net/netfilter/ipvs/ip_vs_ftp.c b/net/netfilter/ipvs/ip_vs_ftp.c
index d30c327..c93c937 100644
--- a/net/netfilter/ipvs/ip_vs_ftp.c
+++ b/net/netfilter/ipvs/ip_vs_ftp.c
@@ -482,11 +482,8 @@ 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.7.4



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

* Re: [PATCH 2/2] netfilter: ipvs: Compress return logic
  2017-03-21 13:23 ` [PATCH 2/2] netfilter: ipvs: " simran singhal
@ 2017-03-21 15:49   ` Sergei Shtylyov
  0 siblings, 0 replies; 4+ messages in thread
From: Sergei Shtylyov @ 2017-03-21 15:49 UTC (permalink / raw)
  To: simran singhal, pablo
  Cc: kadlec, davem, netfilter-devel, coreteam, netdev, linux-kernel,
	gregkh, outreachy-kernel, wensong, horms, ja

Hello!

On 03/21/2017 04:23 PM, simran singhal wrote:

> Simplify function returns by merging assignment and return into
> one command line.

    You mean "one statement"?

> Signed-off-by: simran singhal <singhalsimran0@gmail.com>
> ---
>
>  --This is my contribution to the netfilter project of
>    Outreachy Round 14.
>
>  net/netfilter/ipvs/ip_vs_ftp.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
>
> diff --git a/net/netfilter/ipvs/ip_vs_ftp.c b/net/netfilter/ipvs/ip_vs_ftp.c
> index d30c327..c93c937 100644
> --- a/net/netfilter/ipvs/ip_vs_ftp.c
> +++ b/net/netfilter/ipvs/ip_vs_ftp.c
> @@ -482,11 +482,8 @@ 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);
>  }
>
>  /*

MBR, Sergei



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

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

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-21 13:23 [PATCH 0/2] netfilter: ,netdev@vger.kernel.org simran singhal
2017-03-21 13:23 ` [PATCH 1/2] netfilter: ipset: Compress return logic simran singhal
2017-03-21 13:23 ` [PATCH 2/2] netfilter: ipvs: " simran singhal
2017-03-21 15:49   ` Sergei Shtylyov

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.