Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932140AbdC1JHE (ORCPT ); Tue, 28 Mar 2017 05:07:04 -0400 Received: from mail-pg0-f65.google.com ([74.125.83.65]:35238 "EHLO mail-pg0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932100AbdC1JHB (ORCPT ); Tue, 28 Mar 2017 05:07:01 -0400 Date: Tue, 28 Mar 2017 14:36:33 +0530 From: simran singhal To: pablo@netfilter.org Cc: kadlec@blackhole.kfki.hu, davem@davemloft.net, netfilter-devel@vger.kernel.org, coreteam@netfilter.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, gregkh@linuxfoundation.org, outreachy-kernel@googlegroups.com, wensong@linux-vs.org, horms@verge.net.au, ja@ssi.bg Subject: [PATCH v3] netfilter: Compress return logic Message-ID: <20170328090633.GA22149@singhal-Inspiron-5558> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1487 Lines: 57 Simplify function returns by merging assignment and return into one statement. Signed-off-by: simran singhal --- v3: -change commit message. -merge two patches into one. v2: -Change the subject of cover patch net/netfilter/ipset/ip_set_list_set.c | 5 +---- net/netfilter/ipvs/ip_vs_ftp.c | 5 +---- 2 files changed, 2 insertions(+), 8 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 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