Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ipv6: suppress sparse warnings in IP6_ECN_set_ce()

Pass the correct type __wsum to csum_sub() and csum_add(). This doesn't
really change anything since __wsum really *is* __be32, but removes the
address space warnings from sparse.

Cc: Eric Dumazet <edumazet@google.com>
Fixes: 34ae6a1aa054 ("ipv6: update skb->csum when CE mark is propagated")
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Acked-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Johannes Berg and committed by
David S. Miller
c15c0ab1 0ed661d5

+2 -1
+2 -1
include/net/inet_ecn.h
··· 128 128 to = from | htonl(INET_ECN_CE << 20); 129 129 *(__be32 *)iph = to; 130 130 if (skb->ip_summed == CHECKSUM_COMPLETE) 131 - skb->csum = csum_add(csum_sub(skb->csum, from), to); 131 + skb->csum = csum_add(csum_sub(skb->csum, (__force __wsum)from), 132 + (__force __wsum)to); 132 133 return 1; 133 134 } 134 135