Explorar o código

ipv6: fix sparse errors in ip6_make_flowlabel()

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>
Signed-off-by: David S. Miller <davem@davemloft.net>
Eric Dumazet %!s(int64=10) %!d(string=hai) anos
pai
achega
677651462c
Modificáronse 1 ficheiros con 2 adicións e 2 borrados
  1. 2 2
      include/net/ipv6.h

+ 2 - 2
include/net/ipv6.h

@@ -711,7 +711,7 @@ static inline __be32 ip6_make_flowlabel(struct net *net, struct sk_buff *skb,
 					__be32 flowlabel, bool autolabel)
 					__be32 flowlabel, bool autolabel)
 {
 {
 	if (!flowlabel && (autolabel || net->ipv6.sysctl.auto_flowlabels)) {
 	if (!flowlabel && (autolabel || net->ipv6.sysctl.auto_flowlabels)) {
-		__be32 hash;
+		u32 hash;
 
 
 		hash = skb_get_hash(skb);
 		hash = skb_get_hash(skb);
 
 
@@ -721,7 +721,7 @@ static inline __be32 ip6_make_flowlabel(struct net *net, struct sk_buff *skb,
 		 */
 		 */
 		hash ^= hash >> 12;
 		hash ^= hash >> 12;
 
 
-		flowlabel = hash & IPV6_FLOWLABEL_MASK;
+		flowlabel = (__force __be32)hash & IPV6_FLOWLABEL_MASK;
 	}
 	}
 
 
 	return flowlabel;
 	return flowlabel;