1 /* SPDX-License-Identifier: GPL-2.0-only */
5 static inline unsigned int hash_str(const char *s
)
8 unsigned int hash
= 2166136261U;
11 hash
= (hash
^ *s
) * 0x01000193;
15 /* simplified version of functions from include/linux/hash.h */
16 #define GOLDEN_RATIO_32 0x61C88647
18 static inline unsigned int hash_32(unsigned int val
)
20 return 0x61C88647 * val
;
23 static inline unsigned int hash_ptr(const void *ptr
)
25 return hash_32((unsigned int)(unsigned long)ptr
);