summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/jhash.h32
1 files changed, 7 insertions, 25 deletions
diff --git a/include/linux/jhash.h b/include/linux/jhash.h
index ef973bb2a6c1..83f6af2ebcaa 100644
--- a/include/linux/jhash.h
+++ b/include/linux/jhash.h
@@ -41,7 +41,7 @@
* of bytes. No alignment or length assumptions are made about
* the input key.
*/
-static __inline__ u32 jenkins_hash(void *key, u32 length, u32 initval)
+static inline u32 jhash(void *key, u32 length, u32 initval)
{
u32 a, b, c, len;
u8 *k = key;
@@ -84,7 +84,7 @@ static __inline__ u32 jenkins_hash(void *key, u32 length, u32 initval)
/* A special optimized version that handles 1 or more of u32s.
* The length parameter here is the number of u32s in the key.
*/
-static __inline__ u32 hash2(u32 *k, u32 length, u32 initval)
+static inline u32 jhash2(u32 *k, u32 length, u32 initval)
{
u32 a, b, c, len;
@@ -119,8 +119,7 @@ static __inline__ u32 hash2(u32 *k, u32 length, u32 initval)
* NOTE: In partilar the "c += length; __jhash_mix(a,b,c);" normally
* done at the end is not done here.
*/
-static __inline__ u32 jenkins_hash_3words(u32 a, u32 b, u32 c,
- u32 initval)
+static inline u32 jhash_3words(u32 a, u32 b, u32 c, u32 initval)
{
a += JHASH_GOLDEN_RATIO;
b += JHASH_GOLDEN_RATIO;
@@ -131,31 +130,14 @@ static __inline__ u32 jenkins_hash_3words(u32 a, u32 b, u32 c,
return c;
}
-static __inline__ u32 jenkins_hash_2words(u32 a, u32 b, u32 initval)
+static inline u32 jhash_2words(u32 a, u32 b, u32 initval)
{
- u32 c = 0;
-
- a += JHASH_GOLDEN_RATIO;
- b += JHASH_GOLDEN_RATIO;
- c += initval;
-
- __jhash_mix(a, b, c);
-
- return c;
+ return jhash_3words(a, b, 0, initval);
}
-static __inline__ u32 jenkins_hash_1word(u32 a, u32 initval)
+static inline u32 jhash_1word(u32 a, u32 initval)
{
- u32 b = 0;
- u32 c = 0;
-
- a += JHASH_GOLDEN_RATIO;
- b += JHASH_GOLDEN_RATIO;
- c += initval;
-
- __jhash_mix(a, b, c);
-
- return c;
+ return jhash_3words(a, 0, 0, initval);
}
#endif /* _LINUX_JHASH_H */