* [PATCH v2] ipv6: suppress sparse warnings in IP6_ECN_set_ce()
@ 2016-08-12 5:48 Johannes Berg
2016-08-12 13:11 ` Eric Dumazet
2016-08-13 22:08 ` David Miller
0 siblings, 2 replies; 3+ messages in thread
From: Johannes Berg @ 2016-08-12 5:48 UTC (permalink / raw)
To: netdev; +Cc: Eric Dumazet, Johannes Berg
From: Johannes Berg <johannes.berg@intel.com>
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>
---
include/net/inet_ecn.h | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/include/net/inet_ecn.h b/include/net/inet_ecn.h
index 0dc0a51da38f..dce2d586d9ce 100644
--- a/include/net/inet_ecn.h
+++ b/include/net/inet_ecn.h
@@ -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;
}
--
2.8.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH v2] ipv6: suppress sparse warnings in IP6_ECN_set_ce()
2016-08-12 5:48 [PATCH v2] ipv6: suppress sparse warnings in IP6_ECN_set_ce() Johannes Berg
@ 2016-08-12 13:11 ` Eric Dumazet
2016-08-13 22:08 ` David Miller
1 sibling, 0 replies; 3+ messages in thread
From: Eric Dumazet @ 2016-08-12 13:11 UTC (permalink / raw)
To: Johannes Berg; +Cc: netdev, Eric Dumazet, Johannes Berg
On Fri, 2016-08-12 at 07:48 +0200, Johannes Berg wrote:
> From: Johannes Berg <johannes.berg@intel.com>
>
> 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>
> ---
> include/net/inet_ecn.h | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/include/net/inet_ecn.h b/include/net/inet_ecn.h
> index 0dc0a51da38f..dce2d586d9ce 100644
> --- a/include/net/inet_ecn.h
> +++ b/include/net/inet_ecn.h
> @@ -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;
> }
>
Thanks Johannes
Acked-by: Eric Dumazet <edumazet@google.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v2] ipv6: suppress sparse warnings in IP6_ECN_set_ce()
2016-08-12 5:48 [PATCH v2] ipv6: suppress sparse warnings in IP6_ECN_set_ce() Johannes Berg
2016-08-12 13:11 ` Eric Dumazet
@ 2016-08-13 22:08 ` David Miller
1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2016-08-13 22:08 UTC (permalink / raw)
To: johannes; +Cc: netdev, edumazet, johannes.berg
From: Johannes Berg <johannes@sipsolutions.net>
Date: Fri, 12 Aug 2016 07:48:21 +0200
> From: Johannes Berg <johannes.berg@intel.com>
>
> 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>
Applied, thanks.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-08-14 8:43 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-12 5:48 [PATCH v2] ipv6: suppress sparse warnings in IP6_ECN_set_ce() Johannes Berg
2016-08-12 13:11 ` Eric Dumazet
2016-08-13 22:08 ` David Miller
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.