Skip to content

Commit c47d36b

Browse files
ArushiSinghalummakynes
authored andcommitted
netfilter: Merge assignment with return
Merge assignment with return statement to directly return the value. Signed-off-by: Arushi Singhal <[email protected]> Signed-off-by: Pablo Neira Ayuso <[email protected]>
1 parent a3073c1 commit c47d36b

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

net/netfilter/nf_conntrack_netlink.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1527,9 +1527,8 @@ ctnetlink_setup_nat(struct nf_conn *ct, const struct nlattr * const cda[])
15271527
if (ret < 0)
15281528
return ret;
15291529

1530-
ret = ctnetlink_parse_nat_setup(ct, NF_NAT_MANIP_SRC,
1531-
cda[CTA_NAT_SRC]);
1532-
return ret;
1530+
return ctnetlink_parse_nat_setup(ct, NF_NAT_MANIP_SRC,
1531+
cda[CTA_NAT_SRC]);
15331532
#else
15341533
if (!cda[CTA_NAT_DST] && !cda[CTA_NAT_SRC])
15351534
return 0;

net/netfilter/xt_hashlimit.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -534,8 +534,7 @@ static u64 user2rate_bytes(u32 user)
534534
u64 r;
535535

536536
r = user ? U32_MAX / user : U32_MAX;
537-
r = (r - 1) << XT_HASHLIMIT_BYTE_SHIFT;
538-
return r;
537+
return (r - 1) << XT_HASHLIMIT_BYTE_SHIFT;
539538
}
540539

541540
static void rateinfo_recalc(struct dsthash_ent *dh, unsigned long now,

0 commit comments

Comments
 (0)