netfilter: Merge assignment with return
authorArushi Singhal <arushisinghal19971997@gmail.com>
Wed, 28 Mar 2018 19:09:50 +0000 (00:39 +0530)
committerPablo Neira Ayuso <pablo@netfilter.org>
Fri, 30 Mar 2018 09:44:27 +0000 (11:44 +0200)
Merge assignment with return statement to directly return the value.

Signed-off-by: Arushi Singhal <arushisinghal19971997@gmail.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
net/netfilter/nf_conntrack_netlink.c
net/netfilter/xt_hashlimit.c

index 11ef85a57244a8600e5080a734d7334b6f28b1d8..b00e84bf410738a1c953c19feebed918946409b5 100644 (file)
@@ -1527,9 +1527,8 @@ ctnetlink_setup_nat(struct nf_conn *ct, const struct nlattr * const cda[])
        if (ret < 0)
                return ret;
 
-       ret = ctnetlink_parse_nat_setup(ct, NF_NAT_MANIP_SRC,
-                                       cda[CTA_NAT_SRC]);
-       return ret;
+       return ctnetlink_parse_nat_setup(ct, NF_NAT_MANIP_SRC,
+                                        cda[CTA_NAT_SRC]);
 #else
        if (!cda[CTA_NAT_DST] && !cda[CTA_NAT_SRC])
                return 0;
index db2fe0911740482ba6b658e553600e2c5d759b00..64fc3721d74cf6e12b3de439a7a3f21bfb135e77 100644 (file)
@@ -534,8 +534,7 @@ static u64 user2rate_bytes(u32 user)
        u64 r;
 
        r = user ? U32_MAX / user : U32_MAX;
-       r = (r - 1) << XT_HASHLIMIT_BYTE_SHIFT;
-       return r;
+       return (r - 1) << XT_HASHLIMIT_BYTE_SHIFT;
 }
 
 static void rateinfo_recalc(struct dsthash_ent *dh, unsigned long now,