netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Lance Richardson <lrichard@redhat.com>
To: netdev@vger.kernel.org
Subject: [PATCH net 2/3] ipv4: eliminate endianness warnings in ip_fib.h
Date: Wed,  6 Jan 2016 17:22:46 -0500	[thread overview]
Message-ID: <1452118967-32123-3-git-send-email-lrichard@redhat.com> (raw)
In-Reply-To: <1452118967-32123-1-git-send-email-lrichard@redhat.com>

fib_multipath_hash() computes a hash using __be32 values, force
cast these to u32 to pacify sparse.

Signed-off-by: Lance Richardson <lrichard@redhat.com>
---
 include/net/ip_fib.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/include/net/ip_fib.h b/include/net/ip_fib.h
index 9f4df68..7029527 100644
--- a/include/net/ip_fib.h
+++ b/include/net/ip_fib.h
@@ -325,7 +325,8 @@ extern u32 fib_multipath_secret __read_mostly;
 
 static inline int fib_multipath_hash(__be32 saddr, __be32 daddr)
 {
-	return jhash_2words(saddr, daddr, fib_multipath_secret) >> 1;
+	return jhash_2words((__force u32)saddr, (__force u32)daddr,
+			    fib_multipath_secret) >> 1;
 }
 
 void fib_select_multipath(struct fib_result *res, int hash);
-- 
2.5.0

  parent reply	other threads:[~2016-01-06 22:22 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-06 22:22 [PATCH net 0/3] ipv4: fix various issues reported by sparse Lance Richardson
2016-01-06 22:22 ` [PATCH net 1/3] ipv4: fix endianness warnings in ip_tunnel_core.c Lance Richardson
2016-01-06 22:22 ` Lance Richardson [this message]
2016-01-06 22:22 ` [PATCH net 3/3] ipv4: eliminate lock count warnings in ping.c Lance Richardson
2016-01-06 23:08 ` Fwd: [PATCH net 0/3] ipv4: fix various issues reported by sparse Lance Richardson
2016-01-09  2:31 ` 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=1452118967-32123-3-git-send-email-lrichard@redhat.com \
    --to=lrichard@redhat.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).