ipv6: ICMPV6: Use swap() instead of open coding it
Subsystems (3)
PATCH 1/1 ipv6: ICMPV6: Use swap() instead of open coding it
Clean the following coccicheck warning:
./net/ipv6/icmp.c:348:25-26: WARNING opportunity for swap().
Reported-by Abaci Robot <[email protected]>
Signed-off-by Jiapeng Chong <[email protected]>
--- net/ipv6/icmp.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
net/ipv6/icmp.c +1 -4
@@ -336,7 +336,6 @@ static void mip6_addr_swap(struct sk_buff *skb, const struct inet6_skb_parm *opt {struct ipv6hdr *iph =ipv6_hdr (skb);struct ipv6_destopt_hao *hao; -struct in6_addr tmp;int off;if (opt->dsthao) {
@@ -344,9 +343,7 @@ static void mip6_addr_swap(struct sk_buff *skb, const struct inet6_skb_parm *optif (likely (off >=0 )) { hao = (struct ipv6_destopt_hao *) (skb_network_header (skb) + off); - tmp = iph->saddr; - iph->saddr = hao->addr; - hao->addr = tmp; +swap (iph->saddr, hao->addr); } } }
Signature · 1 line
2.20.1.7.g153144c
Quoted 10 lines · Jiapeng Chong
Clean the following coccicheck warning:
./net/ipv6/icmp.c:348:25-26: WARNING opportunity for
swap().Reported-by Abaci Robot <[email protected]>Signed-off-by Jiapeng Chong <[email protected]>--- net/ipv6/icmp.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
looks fine to me but net-next is closed; resubmit when it opens.
Also, you need to add the tree to the subject line so in this case:
[PATCH net-next] ipv6: ICMPV6: Use swap() instead of open coding it