aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/hash.h
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2014-10-06 08:01:11 -0400
committerTakashi Iwai <tiwai@suse.de>2014-10-06 08:01:11 -0400
commit8df22a4d6f5b81c9c1703579d4907b57002689ed (patch)
tree064e9662d427a82076e1151fcd9aa78a1066f9f4 /include/linux/hash.h
parent0cae90a96c15f2fd3bd139ba5505755c9c9ef2eb (diff)
parenta5448c88b812390a3622e76d774e10c0da1fb970 (diff)
Merge tag 'asoc-v3.18' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-next
ASoC: Updates for v3.18 - More componentisation work from Lars-Peter, this time mainly cleaning up the suspend and bias level transition callbacks. - Real system support for the Intel drivers and a bunch of fixes and enhancements for the associated CODEC drivers, this is going to need a lot quirks over time due to the lack of any firmware description of the boards. - Jack detect support for simple card from Dylan Reid. - A bunch of small fixes and enhancements for the Freescale drivers. - New drivers for Analog Devices SSM4567, Cirrus Logic CS35L32, Everest Semiconductor ES8328 and Freescale cards using the ASRC in newer i.MX processors.
Diffstat (limited to 'include/linux/hash.h')
-rw-r--r--include/linux/hash.h4
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)
37{ 37{
38 u64 hash = val; 38 u64 hash = val;
39 39
40#if defined(CONFIG_ARCH_HAS_FAST_MULTIPLIER) && BITS_PER_LONG == 64
41 hash = hash * GOLDEN_RATIO_PRIME_64;
42#else
40 /* Sigh, gcc can't optimise this alone like it does for 32 bits. */ 43 /* Sigh, gcc can't optimise this alone like it does for 32 bits. */
41 u64 n = hash; 44 u64 n = hash;
42 n <<= 18; 45 n <<= 18;
@@ -51,6 +54,7 @@ static __always_inline u64 hash_64(u64 val, unsigned int bits)
51 hash += n; 54 hash += n;
52 n <<= 2; 55 n <<= 2;
53 hash += n; 56 hash += n;
57#endif
54 58
55 /* High bits are more random, so use them. */ 59 /* High bits are more random, so use them. */
56 return hash >> (64 - bits); 60 return hash >> (64 - bits);