From: Nicolas Dichtel <nicolas.dichtel@6wind.com>
To: fengguang.wu@intel.com
Cc: netdev@vger.kernel.org, Nicolas Dichtel <nicolas.dichtel@6wind.com>
Subject: [PATCH net-next] ipv6: fix sparse warnings in rt6_info_hash_nhsfn()
Date: Tue, 23 Oct 2012 11:35:06 +0200 [thread overview]
Message-ID: <1350984906-24672-1-git-send-email-nicolas.dichtel@6wind.com> (raw)
In-Reply-To: <508653b5.7Vy7DCd02KcUpUab%fengguang.wu@intel.com>
Adding by commit 51ebd3181572 which adds the support of ECMP for IPv6.
Spotted-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
---
net/ipv6/route.c | 26 +++++++++++++-------------
1 file changed, 13 insertions(+), 13 deletions(-)
diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index 126da56..c42650c 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -397,32 +397,32 @@ static int rt6_info_hash_nhsfn(unsigned int candidate_count,
{
unsigned int val = fl6->flowi6_proto;
- val ^= fl6->daddr.s6_addr32[0];
- val ^= fl6->daddr.s6_addr32[1];
- val ^= fl6->daddr.s6_addr32[2];
- val ^= fl6->daddr.s6_addr32[3];
+ val ^= (__force u32)fl6->daddr.s6_addr32[0];
+ val ^= (__force u32)fl6->daddr.s6_addr32[1];
+ val ^= (__force u32)fl6->daddr.s6_addr32[2];
+ val ^= (__force u32)fl6->daddr.s6_addr32[3];
- val ^= fl6->saddr.s6_addr32[0];
- val ^= fl6->saddr.s6_addr32[1];
- val ^= fl6->saddr.s6_addr32[2];
- val ^= fl6->saddr.s6_addr32[3];
+ val ^= (__force u32)fl6->saddr.s6_addr32[0];
+ val ^= (__force u32)fl6->saddr.s6_addr32[1];
+ val ^= (__force u32)fl6->saddr.s6_addr32[2];
+ val ^= (__force u32)fl6->saddr.s6_addr32[3];
/* Work only if this not encapsulated */
switch (fl6->flowi6_proto) {
case IPPROTO_UDP:
case IPPROTO_TCP:
case IPPROTO_SCTP:
- val ^= fl6->fl6_sport;
- val ^= fl6->fl6_dport;
+ val ^= (__force u16)fl6->fl6_sport;
+ val ^= (__force u16)fl6->fl6_dport;
break;
case IPPROTO_ICMPV6:
- val ^= fl6->fl6_icmp_type;
- val ^= fl6->fl6_icmp_code;
+ val ^= (__force u16)fl6->fl6_icmp_type;
+ val ^= (__force u16)fl6->fl6_icmp_code;
break;
}
/* RFC6438 recommands to use flowlabel */
- val ^= fl6->flowlabel;
+ val ^= (__force u32)fl6->flowlabel;
/* Perhaps, we need to tune, this function? */
val = val ^ (val >> 7) ^ (val >> 12);
--
1.7.12
next prev parent reply other threads:[~2012-10-23 9:26 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-23 8:22 [net-next:master 35/53] net/ipv6/route.c:400:13: sparse: invalid assignment: ^= Fengguang Wu
2012-10-23 8:58 ` Nicolas Dichtel
2012-10-23 9:35 ` Nicolas Dichtel [this message]
2012-10-23 17:06 ` [PATCH net-next] ipv6: fix sparse warnings in rt6_info_hash_nhsfn() David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1350984906-24672-1-git-send-email-nicolas.dichtel@6wind.com \
--to=nicolas.dichtel@6wind.com \
--cc=fengguang.wu@intel.com \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).