Skip to content

Commit

Permalink
ipv6: suppress sparse warnings in IP6_ECN_set_ce()
Browse files Browse the repository at this point in the history
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 <[email protected]>
Fixes: 34ae6a1 ("ipv6: update skb->csum when CE mark is propagated")
Signed-off-by: Johannes Berg <[email protected]>
Acked-by: Eric Dumazet <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
jmberg-intel authored and davem330 committed Aug 13, 2016
1 parent 0ed661d commit c15c0ab
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion include/net/inet_ecn.h
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,8 @@ static inline int IP6_ECN_set_ce(struct sk_buff *skb, struct ipv6hdr *iph)
to = from | htonl(INET_ECN_CE << 20);
*(__be32 *)iph = to;
if (skb->ip_summed == CHECKSUM_COMPLETE)
skb->csum = csum_add(csum_sub(skb->csum, from), to);
skb->csum = csum_add(csum_sub(skb->csum, (__force __wsum)from),
(__force __wsum)to);
return 1;
}

Expand Down

0 comments on commit c15c0ab

Please sign in to comment.