Skip to content

Commit ad57dae

Browse files
luo penghaoklassert
authored andcommitted
xfrm: Remove redundant fields and related parentheses
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 <[email protected]> Signed-off-by: luo penghao <[email protected]> Signed-off-by: Steffen Klassert <[email protected]>
1 parent 83688ae commit ad57dae

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

net/xfrm/xfrm_input.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -530,7 +530,7 @@ int xfrm_input(struct sk_buff *skb, int nexthdr, __be32 spi, int encap_type)
530530
goto drop;
531531
}
532532

533-
if ((err = xfrm_parse_spi(skb, nexthdr, &spi, &seq)) != 0) {
533+
if (xfrm_parse_spi(skb, nexthdr, &spi, &seq)) {
534534
XFRM_INC_STATS(net, LINUX_MIB_XFRMINHDRERROR);
535535
goto drop;
536536
}
@@ -560,7 +560,7 @@ int xfrm_input(struct sk_buff *skb, int nexthdr, __be32 spi, int encap_type)
560560
}
561561

562562
seq = 0;
563-
if (!spi && (err = xfrm_parse_spi(skb, nexthdr, &spi, &seq)) != 0) {
563+
if (!spi && xfrm_parse_spi(skb, nexthdr, &spi, &seq)) {
564564
secpath_reset(skb);
565565
XFRM_INC_STATS(net, LINUX_MIB_XFRMINHDRERROR);
566566
goto drop;

0 commit comments

Comments
 (0)