* [PATCH v3] netfilter: Compress return logic
@ 2017-03-28 9:06 simran singhal
0 siblings, 0 replies; only message in thread
From: simran singhal @ 2017-03-28 9:06 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
statement.
Signed-off-by: simran singhal <singhalsimran0@gmail.com>
---
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
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2017-03-28 9:06 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-03-28 9:06 [PATCH v3] netfilter: Compress return logic simran singhal
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).