Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1605596 > unrolled thread

[PATCH v2 1/2] netfilter: ipset: Compress return logic

Started bysimran singhal <singhalsimran0@gmail.com>
First post2017-03-21 14:40 +0100
Last post2017-03-21 14:40 +0100
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH v2 1/2] netfilter: ipset: Compress return logic simran singhal <singhalsimran0@gmail.com> - 2017-03-21 14:40 +0100

#1605596 — [PATCH v2 1/2] netfilter: ipset: Compress return logic

Fromsimran singhal <singhalsimran0@gmail.com>
Date2017-03-21 14:40 +0100
Subject[PATCH v2 1/2] netfilter: ipset: Compress return logic
Message-ID<tnsb0-3W4-19@gated-at.bofh.it>
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

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web