* [PATCH] ipv6: fix sparse errors in ip6_make_flowlabel()
@ 2015-02-04 23:03 Eric Dumazet
2015-02-05 8:42 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Eric Dumazet @ 2015-02-04 23:03 UTC (permalink / raw)
To: David Miller; +Cc: netdev
From: Eric Dumazet <edumazet@google.com>
include/net/ipv6.h:713:22: warning: incorrect type in assignment (different base types)
include/net/ipv6.h:713:22: expected restricted __be32 [usertype] hash
include/net/ipv6.h:713:22: got unsigned int
include/net/ipv6.h:719:25: warning: restricted __be32 degrades to integer
include/net/ipv6.h:719:22: warning: invalid assignment: ^=
include/net/ipv6.h:719:22: left side has type restricted __be32
include/net/ipv6.h:719:22: right side has type unsigned int
Signed-off-by: Eric Dumazet <edumazet@google.com>
---
include/net/ipv6.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/include/net/ipv6.h b/include/net/ipv6.h
index 8027ca53e31f5903e055c425fef097ca9ccaa173..a419d766e9b538ab5eda9f4c3ee5e6244de5cf7e 100644
--- a/include/net/ipv6.h
+++ b/include/net/ipv6.h
@@ -708,7 +708,7 @@ static inline __be32 ip6_make_flowlabel(struct net *net, struct sk_buff *skb,
__be32 flowlabel, bool autolabel)
{
if (!flowlabel && (autolabel || net->ipv6.sysctl.auto_flowlabels)) {
- __be32 hash;
+ u32 hash;
hash = skb_get_hash(skb);
@@ -718,7 +718,7 @@ static inline __be32 ip6_make_flowlabel(struct net *net, struct sk_buff *skb,
*/
hash ^= hash >> 12;
- flowlabel = hash & IPV6_FLOWLABEL_MASK;
+ flowlabel = (__force __be32)hash & IPV6_FLOWLABEL_MASK;
}
return flowlabel;
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] ipv6: fix sparse errors in ip6_make_flowlabel()
2015-02-04 23:03 [PATCH] ipv6: fix sparse errors in ip6_make_flowlabel() Eric Dumazet
@ 2015-02-05 8:42 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2015-02-05 8:42 UTC (permalink / raw)
To: eric.dumazet; +Cc: netdev
From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Wed, 04 Feb 2015 15:03:25 -0800
> From: Eric Dumazet <edumazet@google.com>
>
> include/net/ipv6.h:713:22: warning: incorrect type in assignment (different base types)
> include/net/ipv6.h:713:22: expected restricted __be32 [usertype] hash
> include/net/ipv6.h:713:22: got unsigned int
> include/net/ipv6.h:719:25: warning: restricted __be32 degrades to integer
> include/net/ipv6.h:719:22: warning: invalid assignment: ^=
> include/net/ipv6.h:719:22: left side has type restricted __be32
> include/net/ipv6.h:719:22: right side has type unsigned int
>
> Signed-off-by: Eric Dumazet <edumazet@google.com>
Applied.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-02-05 8:42 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-02-04 23:03 [PATCH] ipv6: fix sparse errors in ip6_make_flowlabel() Eric Dumazet
2015-02-05 8:42 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).