Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932680AbdCUNXp (ORCPT ); Tue, 21 Mar 2017 09:23:45 -0400 Received: from mail-pg0-f66.google.com ([74.125.83.66]:35175 "EHLO mail-pg0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932499AbdCUNXl (ORCPT ); Tue, 21 Mar 2017 09:23:41 -0400 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 1/2] netfilter: ipset: Compress return logic Date: Tue, 21 Mar 2017 18:53:18 +0530 Message-Id: <1490102599-27579-2-git-send-email-singhalsimran0@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1490102599-27579-1-git-send-email-singhalsimran0@gmail.com> References: <1490102599-27579-1-git-send-email-singhalsimran0@gmail.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 935 Lines: 37 Simplify function returns by merging assignment and return into one command line. Signed-off-by: simran singhal --- --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