netfilter: ipset: Compress return logic
authorsimran singhal <singhalsimran0@gmail.com>
Mon, 11 Sep 2017 19:52:37 +0000 (21:52 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Wed, 4 Oct 2017 14:19:06 +0000 (16:19 +0200)
Simplify function returns by merging assignment and return into one
command line.

Signed-off-by: simran singhal <singhalsimran0@gmail.com>
Signed-off-by: Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
net/netfilter/ipset/ip_set_list_set.c

index 178d4eba013b480ede5a54e121e5b0b92fc2edc1..2fff6b5dc6f0bee83bbd464d8a7d09c190be57a0 100644 (file)
@@ -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