[PATCH] net: ipv4: Fix some coding style in ah4.c file

From: Jingyu Wang
Date: Thu Sep 08 2022 - 07:13:59 EST


Fix some checkpatch.pl complained about in ah4.c

Signed-off-by: Jingyu Wang <jingyuwang_vip@xxxxxxx>
---
net/ipv4/ah4.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/net/ipv4/ah4.c b/net/ipv4/ah4.c
index f8ad04470d3a..873c5c495461 100644
--- a/net/ipv4/ah4.c
+++ b/net/ipv4/ah4.c
@@ -93,7 +93,7 @@ static int ip_clear_mutable_options(const struct iphdr *iph, __be32 *daddr)
continue;
}
optlen = optptr[1];
- if (optlen<2 || optlen>l)
+ if (optlen < 2 || optlen > l)
return -EINVAL;
switch (*optptr) {
case IPOPT_SEC:
@@ -165,7 +165,8 @@ static int ah_output(struct xfrm_state *x, struct sk_buff *skb)
ahp = x->data;
ahash = ahp->ahash;

- if ((err = skb_cow_data(skb, 0, &trailer)) < 0)
+ err = skb_cow_data(skb, 0, &trailer);
+ if (err < 0)
goto out;
nfrags = err;

@@ -352,7 +353,8 @@ static int ah_input(struct xfrm_state *x, struct sk_buff *skb)
skb->ip_summed = CHECKSUM_NONE;


- if ((err = skb_cow_data(skb, 0, &trailer)) < 0)
+ err = skb_cow_data(skb, 0, &trailer);
+ if (err < 0)
goto out;
nfrags = err;

@@ -553,8 +555,7 @@ static int ah4_rcv_cb(struct sk_buff *skb, int err)
return 0;
}

-static const struct xfrm_type ah_type =
-{
+static const struct xfrm_type ah_type = {
.owner = THIS_MODULE,
.proto = IPPROTO_AH,
.flags = XFRM_TYPE_REPLAY_PROT,

base-commit: 5957ac6635a1a12d4aa2661bbf04d3085a73372a
--
2.34.1