netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net: ipv4: Fix some coding style in ah4.c file
@ 2022-09-08 11:12 Jingyu Wang
  2022-09-08 20:34 ` Andrew Lunn
  2022-09-19 19:16 ` Jakub Kicinski
  0 siblings, 2 replies; 7+ messages in thread
From: Jingyu Wang @ 2022-09-08 11:12 UTC (permalink / raw)
  To: steffen.klassert, herbert, davem, yoshfuji, dsahern, edumazet,
	kuba, pabeni
  Cc: netdev, linux-kernel, Jingyu Wang

Fix some checkpatch.pl complained about in ah4.c

Signed-off-by: Jingyu Wang <jingyuwang_vip@163.com>
---
 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


^ permalink raw reply related	[flat|nested] 7+ messages in thread
* [PATCH] net: ipv4: Fix some coding style in ah4.c file
@ 2022-09-08  2:21 Jingyu Wang
  2022-09-08  6:45 ` kernel test robot
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Jingyu Wang @ 2022-09-08  2:21 UTC (permalink / raw)
  To: steffen.klassert, herbert, davem, yoshfuji, dsahern, edumazet,
	kuba, pabeni
  Cc: netdev, linux-kernel, Jingyu Wang

Fix some checkpatch.pl complained about in ah4.c

Signed-off-by: Jingyu Wang <jingyuwang_vip@163.com>
---
 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..fe4715e7c80e 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


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2022-09-19 19:16 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-09-08 11:12 [PATCH] net: ipv4: Fix some coding style in ah4.c file Jingyu Wang
2022-09-08 20:34 ` Andrew Lunn
2022-09-19 19:16 ` Jakub Kicinski
  -- strict thread matches above, loose matches on Subject: below --
2022-09-08  2:21 Jingyu Wang
2022-09-08  6:45 ` kernel test robot
2022-09-08  7:41 ` kernel test robot
2022-09-08 20:25 ` Andrew Lunn

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).