All of lore.kernel.org
 help / color / mirror / Atom feed
* pull request (net-next): ipsec-next 2021-10-30
@ 2021-10-30  7:26 Steffen Klassert
  2021-10-30  7:26 ` [PATCH 1/2] net/ipv4/xfrm4_tunnel.c: remove superfluous header files from xfrm4_tunnel.c Steffen Klassert
  2021-10-30  7:26 ` [PATCH 2/2] xfrm: Remove redundant fields and related parentheses Steffen Klassert
  0 siblings, 2 replies; 4+ messages in thread
From: Steffen Klassert @ 2021-10-30  7:26 UTC (permalink / raw)
  To: David Miller, Jakub Kicinski; +Cc: Herbert Xu, Steffen Klassert, netdev

Just two minor changes this time:

1) Remove some superfluous header files from xfrm4_tunnel.c
   From Mianhan Liu.

2) Simplify some error checks in xfrm_input().
   From luo penghao.

Please pull or let me know if there are problems.

Thanks!

The following changes since commit 428168f9951710854d8d1abf6ca03a8bdab0ccc5:

  Merge branch 'mlxsw-trap-adjacency' (2021-09-22 14:35:02 +0100)

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 ad57dae8a64da3926a22debbbe7d3b487a685a08:

  xfrm: Remove redundant fields and related parentheses (2021-10-28 07:56:02 +0200)

----------------------------------------------------------------
Mianhan Liu (1):
      net/ipv4/xfrm4_tunnel.c: remove superfluous header files from xfrm4_tunnel.c

luo penghao (1):
      xfrm: Remove redundant fields and related parentheses

 net/ipv4/xfrm4_tunnel.c | 2 --
 net/xfrm/xfrm_input.c   | 4 ++--
 2 files changed, 2 insertions(+), 4 deletions(-)

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

* [PATCH 1/2] net/ipv4/xfrm4_tunnel.c: remove superfluous header files from xfrm4_tunnel.c
  2021-10-30  7:26 pull request (net-next): ipsec-next 2021-10-30 Steffen Klassert
@ 2021-10-30  7:26 ` Steffen Klassert
  2021-11-01 13:10   ` patchwork-bot+netdevbpf
  2021-10-30  7:26 ` [PATCH 2/2] xfrm: Remove redundant fields and related parentheses Steffen Klassert
  1 sibling, 1 reply; 4+ messages in thread
From: Steffen Klassert @ 2021-10-30  7:26 UTC (permalink / raw)
  To: David Miller, Jakub Kicinski; +Cc: Herbert Xu, Steffen Klassert, netdev

From: Mianhan Liu <liumh1@shanghaitech.edu.cn>

xfrm4_tunnel.c hasn't use any macro or function declared in mutex.h and ip.h
Thus, these files can be removed from xfrm4_tunnel.c safely without affecting
the compilation of the net module.

Signed-off-by: Mianhan Liu <liumh1@shanghaitech.edu.cn>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
---
 net/ipv4/xfrm4_tunnel.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/net/ipv4/xfrm4_tunnel.c b/net/ipv4/xfrm4_tunnel.c
index f4555a88f86b..9d4f418f1bf8 100644
--- a/net/ipv4/xfrm4_tunnel.c
+++ b/net/ipv4/xfrm4_tunnel.c
@@ -8,9 +8,7 @@
 
 #include <linux/skbuff.h>
 #include <linux/module.h>
-#include <linux/mutex.h>
 #include <net/xfrm.h>
-#include <net/ip.h>
 #include <net/protocol.h>
 
 static int ipip_output(struct xfrm_state *x, struct sk_buff *skb)
-- 
2.25.1


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

* [PATCH 2/2] xfrm: Remove redundant fields and related parentheses
  2021-10-30  7:26 pull request (net-next): ipsec-next 2021-10-30 Steffen Klassert
  2021-10-30  7:26 ` [PATCH 1/2] net/ipv4/xfrm4_tunnel.c: remove superfluous header files from xfrm4_tunnel.c Steffen Klassert
@ 2021-10-30  7:26 ` Steffen Klassert
  1 sibling, 0 replies; 4+ messages in thread
From: Steffen Klassert @ 2021-10-30  7:26 UTC (permalink / raw)
  To: David Miller, Jakub Kicinski; +Cc: Herbert Xu, Steffen Klassert, netdev

From: luo penghao <cgel.zte@gmail.com>

The variable err is not necessary in such places. It should be revmoved
for the simplicity of the code. This will cause the double parentheses
to be redundant, and the inner parentheses should be deleted.

The clang_analyzer complains as follows:

net/xfrm/xfrm_input.c:533: warning:
net/xfrm/xfrm_input.c:563: warning:

Although the value stored to 'err' is used in the enclosing expression,
the value is never actually read from 'err'.

Changes in v2:

Modify the title, because v2 removes the brackets.
Remove extra parentheses.

Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: luo penghao <luo.penghao@zte.com.cn>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
---
 net/xfrm/xfrm_input.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/xfrm/xfrm_input.c b/net/xfrm/xfrm_input.c
index 3df0861d4390..70a8c36f0ba6 100644
--- a/net/xfrm/xfrm_input.c
+++ b/net/xfrm/xfrm_input.c
@@ -530,7 +530,7 @@ int xfrm_input(struct sk_buff *skb, int nexthdr, __be32 spi, int encap_type)
 				goto drop;
 			}
 
-			if ((err = xfrm_parse_spi(skb, nexthdr, &spi, &seq)) != 0) {
+			if (xfrm_parse_spi(skb, nexthdr, &spi, &seq)) {
 				XFRM_INC_STATS(net, LINUX_MIB_XFRMINHDRERROR);
 				goto drop;
 			}
@@ -560,7 +560,7 @@ int xfrm_input(struct sk_buff *skb, int nexthdr, __be32 spi, int encap_type)
 	}
 
 	seq = 0;
-	if (!spi && (err = xfrm_parse_spi(skb, nexthdr, &spi, &seq)) != 0) {
+	if (!spi && xfrm_parse_spi(skb, nexthdr, &spi, &seq)) {
 		secpath_reset(skb);
 		XFRM_INC_STATS(net, LINUX_MIB_XFRMINHDRERROR);
 		goto drop;
-- 
2.25.1


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

* Re: [PATCH 1/2] net/ipv4/xfrm4_tunnel.c: remove superfluous header files from xfrm4_tunnel.c
  2021-10-30  7:26 ` [PATCH 1/2] net/ipv4/xfrm4_tunnel.c: remove superfluous header files from xfrm4_tunnel.c Steffen Klassert
@ 2021-11-01 13:10   ` patchwork-bot+netdevbpf
  0 siblings, 0 replies; 4+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-11-01 13:10 UTC (permalink / raw)
  To: Steffen Klassert; +Cc: davem, kuba, herbert, netdev

Hello:

This series was applied to netdev/net-next.git (master)
by Steffen Klassert <steffen.klassert@secunet.com>:

On Sat, 30 Oct 2021 09:26:32 +0200 you wrote:
> From: Mianhan Liu <liumh1@shanghaitech.edu.cn>
> 
> xfrm4_tunnel.c hasn't use any macro or function declared in mutex.h and ip.h
> Thus, these files can be removed from xfrm4_tunnel.c safely without affecting
> the compilation of the net module.
> 
> Signed-off-by: Mianhan Liu <liumh1@shanghaitech.edu.cn>
> Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
> 
> [...]

Here is the summary with links:
  - [1/2] net/ipv4/xfrm4_tunnel.c: remove superfluous header files from xfrm4_tunnel.c
    https://git.kernel.org/netdev/net-next/c/83688aec17bf
  - [2/2] xfrm: Remove redundant fields and related parentheses
    https://git.kernel.org/netdev/net-next/c/ad57dae8a64d

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] 4+ messages in thread

end of thread, other threads:[~2021-11-01 13:10 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-30  7:26 pull request (net-next): ipsec-next 2021-10-30 Steffen Klassert
2021-10-30  7:26 ` [PATCH 1/2] net/ipv4/xfrm4_tunnel.c: remove superfluous header files from xfrm4_tunnel.c Steffen Klassert
2021-11-01 13:10   ` patchwork-bot+netdevbpf
2021-10-30  7:26 ` [PATCH 2/2] xfrm: Remove redundant fields and related parentheses Steffen Klassert

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.