diff options
| author | 2014-09-14 22:26:10 -0700 | |
|---|---|---|
| committer | 2014-09-14 22:26:10 -0700 | |
| commit | ce4df0b01259dc033c3ec8f855a3978818c3315d (patch) | |
| tree | 4bd9fa58584aaae78beb53a9c15c67ff32674112 /include/linux/hash.h | |
| parent | usb: dwc2: make the scheduler handle excessive NAKs better (diff) | |
| parent | Linux 3.17-rc5 (diff) | |
Merge 3.17-rc5 into usb-next
We need the USB fixes in there to build on top of in this branch for
3.18.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/linux/hash.h')
| -rw-r--r-- | include/linux/hash.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/include/linux/hash.h b/include/linux/hash.h index bd1754c7ecef..d0494c399392 100644 --- a/include/linux/hash.h +++ b/include/linux/hash.h @@ -37,6 +37,9 @@ static __always_inline u64 hash_64(u64 val, unsigned int bits) { u64 hash = val; +#if defined(CONFIG_ARCH_HAS_FAST_MULTIPLIER) && BITS_PER_LONG == 64 + hash = hash * GOLDEN_RATIO_PRIME_64; +#else /* Sigh, gcc can't optimise this alone like it does for 32 bits. */ u64 n = hash; n <<= 18; @@ -51,6 +54,7 @@ static __always_inline u64 hash_64(u64 val, unsigned int bits) hash += n; n <<= 2; hash += n; +#endif /* High bits are more random, so use them. */ return hash >> (64 - bits); |
