netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* pull request (net-next): ipsec-next 2021-04-14
@ 2021-04-14 10:16 Steffen Klassert
  2021-04-14 10:16 ` [PATCH 1/3] esp4: Simplify the calculation of variables Steffen Klassert
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Steffen Klassert @ 2021-04-14 10:16 UTC (permalink / raw)
  To: David Miller, Jakub Kicinski; +Cc: Herbert Xu, Steffen Klassert, netdev

Not much this time:

1) Simplification of some variable calculations in esp4 and esp6.
   From Jiapeng Chong and Junlin Yang.

2) Fix a clang Wformat warning in esp6 and ah6.
   From Arnd Bergmann.

Please pull or let me know if there are problems.

Thanks!

The following changes since commit 34bb975126419e86bc3b95e200dc41de6c6ca69c:

  net: fddi: skfp: Mundane typo fixes throughout the file smt.h (2021-03-10 15:42:22 -0800)

are available in the Git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/klassert/ipsec-next.git master

for you to fetch changes up to 6ad2dd6c14d3989b44cdc17f1e7258bf613dd070:

  ipv6: fix clang Wformat warning (2021-03-25 09:48:32 +0100)

----------------------------------------------------------------
Arnd Bergmann (1):
      ipv6: fix clang Wformat warning

Jiapeng Chong (1):
      esp4: Simplify the calculation of variables

Junlin Yang (1):
      esp6: remove a duplicative condition

 net/ipv4/esp4.c         | 2 +-
 net/ipv6/ah6.c          | 2 +-
 net/ipv6/esp6.c         | 2 +-
 net/ipv6/esp6_offload.c | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

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

* [PATCH 1/3] esp4: Simplify the calculation of variables
  2021-04-14 10:16 pull request (net-next): ipsec-next 2021-04-14 Steffen Klassert
@ 2021-04-14 10:16 ` Steffen Klassert
  2021-04-14 10:17 ` [PATCH 2/3] esp6: remove a duplicative condition Steffen Klassert
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Steffen Klassert @ 2021-04-14 10:16 UTC (permalink / raw)
  To: David Miller, Jakub Kicinski; +Cc: Herbert Xu, Steffen Klassert, netdev

From: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>

Fix the following coccicheck warnings:

./net/ipv4/esp4.c:757:16-18: WARNING !A || A && B is equivalent to !A || B.

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
---
 net/ipv4/esp4.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/ipv4/esp4.c b/net/ipv4/esp4.c
index a3271ec3e162..804a7698df5b 100644
--- a/net/ipv4/esp4.c
+++ b/net/ipv4/esp4.c
@@ -754,7 +754,7 @@ int esp_input_done2(struct sk_buff *skb, int err)
 	int hlen = sizeof(struct ip_esp_hdr) + crypto_aead_ivsize(aead);
 	int ihl;
 
-	if (!xo || (xo && !(xo->flags & CRYPTO_DONE)))
+	if (!xo || !(xo->flags & CRYPTO_DONE))
 		kfree(ESP_SKB_CB(skb)->tmp);
 
 	if (unlikely(err))
-- 
2.25.1


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

* [PATCH 2/3] esp6: remove a duplicative condition
  2021-04-14 10:16 pull request (net-next): ipsec-next 2021-04-14 Steffen Klassert
  2021-04-14 10:16 ` [PATCH 1/3] esp4: Simplify the calculation of variables Steffen Klassert
@ 2021-04-14 10:17 ` Steffen Klassert
  2021-04-14 10:17 ` [PATCH 3/3] ipv6: fix clang Wformat warning Steffen Klassert
  2021-04-14 20:30 ` pull request (net-next): ipsec-next 2021-04-14 patchwork-bot+netdevbpf
  3 siblings, 0 replies; 5+ messages in thread
From: Steffen Klassert @ 2021-04-14 10:17 UTC (permalink / raw)
  To: David Miller, Jakub Kicinski; +Cc: Herbert Xu, Steffen Klassert, netdev

From: Junlin Yang <yangjunlin@yulong.com>

Fixes coccicheck warnings:
./net/ipv6/esp6_offload.c:319:32-34:
WARNING !A || A && B is equivalent to !A || B

Signed-off-by: Junlin Yang <yangjunlin@yulong.com>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
---
 net/ipv6/esp6_offload.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/ipv6/esp6_offload.c b/net/ipv6/esp6_offload.c
index 1ca516fb30e1..631c168774f5 100644
--- a/net/ipv6/esp6_offload.c
+++ b/net/ipv6/esp6_offload.c
@@ -316,7 +316,7 @@ static int esp6_xmit(struct xfrm_state *x, struct sk_buff *skb,  netdev_features
 	esp.plen = esp.clen - skb->len - esp.tfclen;
 	esp.tailen = esp.tfclen + esp.plen + alen;
 
-	if (!hw_offload || (hw_offload && !skb_is_gso(skb))) {
+	if (!hw_offload || !skb_is_gso(skb)) {
 		esp.nfrags = esp6_output_head(x, skb, &esp);
 		if (esp.nfrags < 0)
 			return esp.nfrags;
-- 
2.25.1


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

* [PATCH 3/3] ipv6: fix clang Wformat warning
  2021-04-14 10:16 pull request (net-next): ipsec-next 2021-04-14 Steffen Klassert
  2021-04-14 10:16 ` [PATCH 1/3] esp4: Simplify the calculation of variables Steffen Klassert
  2021-04-14 10:17 ` [PATCH 2/3] esp6: remove a duplicative condition Steffen Klassert
@ 2021-04-14 10:17 ` Steffen Klassert
  2021-04-14 20:30 ` pull request (net-next): ipsec-next 2021-04-14 patchwork-bot+netdevbpf
  3 siblings, 0 replies; 5+ messages in thread
From: Steffen Klassert @ 2021-04-14 10:17 UTC (permalink / raw)
  To: David Miller, Jakub Kicinski; +Cc: Herbert Xu, Steffen Klassert, netdev

From: Arnd Bergmann <arnd@arndb.de>

When building with 'make W=1', clang warns about a mismatched
format string:

net/ipv6/ah6.c:710:4: error: format specifies type 'unsigned short' but the argument has type 'int' [-Werror,-Wformat]
                        aalg_desc->uinfo.auth.icv_fullbits/8);
                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/printk.h:375:34: note: expanded from macro 'pr_info'
        printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
                                ~~~     ^~~~~~~~~~~
net/ipv6/esp6.c:1153:5: error: format specifies type 'unsigned short' but the argument has type 'int' [-Werror,-Wformat]
                                aalg_desc->uinfo.auth.icv_fullbits / 8);
                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/printk.h:375:34: note: expanded from macro 'pr_info'
        printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
                                ~~~     ^~~~~~~~~~~

Here, the result of dividing a 16-bit number by a 32-bit number
produces a 32-bit result, which is printed as a 16-bit integer.

Change the %hu format to the normal %u, which has the same effect
but avoids the warning.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
---
 net/ipv6/ah6.c  | 2 +-
 net/ipv6/esp6.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/ipv6/ah6.c b/net/ipv6/ah6.c
index 440080da805b..01c638f5d8b8 100644
--- a/net/ipv6/ah6.c
+++ b/net/ipv6/ah6.c
@@ -705,7 +705,7 @@ static int ah6_init_state(struct xfrm_state *x)
 
 	if (aalg_desc->uinfo.auth.icv_fullbits/8 !=
 	    crypto_ahash_digestsize(ahash)) {
-		pr_info("AH: %s digestsize %u != %hu\n",
+		pr_info("AH: %s digestsize %u != %u\n",
 			x->aalg->alg_name, crypto_ahash_digestsize(ahash),
 			aalg_desc->uinfo.auth.icv_fullbits/8);
 		goto error;
diff --git a/net/ipv6/esp6.c b/net/ipv6/esp6.c
index 153ad103ba74..831a588b04a2 100644
--- a/net/ipv6/esp6.c
+++ b/net/ipv6/esp6.c
@@ -1147,7 +1147,7 @@ static int esp_init_authenc(struct xfrm_state *x)
 		err = -EINVAL;
 		if (aalg_desc->uinfo.auth.icv_fullbits / 8 !=
 		    crypto_aead_authsize(aead)) {
-			pr_info("ESP: %s digestsize %u != %hu\n",
+			pr_info("ESP: %s digestsize %u != %u\n",
 				x->aalg->alg_name,
 				crypto_aead_authsize(aead),
 				aalg_desc->uinfo.auth.icv_fullbits / 8);
-- 
2.25.1


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

* Re: pull request (net-next): ipsec-next 2021-04-14
  2021-04-14 10:16 pull request (net-next): ipsec-next 2021-04-14 Steffen Klassert
                   ` (2 preceding siblings ...)
  2021-04-14 10:17 ` [PATCH 3/3] ipv6: fix clang Wformat warning Steffen Klassert
@ 2021-04-14 20:30 ` patchwork-bot+netdevbpf
  3 siblings, 0 replies; 5+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-04-14 20:30 UTC (permalink / raw)
  To: Steffen Klassert; +Cc: davem, kuba, herbert, netdev

Hello:

This pull request was applied to netdev/net-next.git (refs/heads/master):

On Wed, 14 Apr 2021 12:16:58 +0200 you wrote:
> Not much this time:
> 
> 1) Simplification of some variable calculations in esp4 and esp6.
>    From Jiapeng Chong and Junlin Yang.
> 
> 2) Fix a clang Wformat warning in esp6 and ah6.
>    From Arnd Bergmann.
> 
> [...]

Here is the summary with links:
  - pull request (net-next): ipsec-next 2021-04-14
    https://git.kernel.org/netdev/net-next/c/8c1186be3f1b
  - [2/3] esp6: remove a duplicative condition
    https://git.kernel.org/netdev/net-next/c/f076835a8bf2
  - [3/3] ipv6: fix clang Wformat warning
    https://git.kernel.org/netdev/net-next/c/6ad2dd6c14d3

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



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

end of thread, other threads:[~2021-04-14 20:30 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-14 10:16 pull request (net-next): ipsec-next 2021-04-14 Steffen Klassert
2021-04-14 10:16 ` [PATCH 1/3] esp4: Simplify the calculation of variables Steffen Klassert
2021-04-14 10:17 ` [PATCH 2/3] esp6: remove a duplicative condition Steffen Klassert
2021-04-14 10:17 ` [PATCH 3/3] ipv6: fix clang Wformat warning Steffen Klassert
2021-04-14 20:30 ` pull request (net-next): ipsec-next 2021-04-14 patchwork-bot+netdevbpf

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