]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
include/linux/jhash.h: replace __get_unaligned_cpu32 in jhash function
authorJulian Vetter <julian@outer-limits.org>
Tue, 3 Jun 2025 13:21:21 +0000 (15:21 +0200)
committerAndrew Morton <akpm@linux-foundation.org>
Thu, 10 Jul 2025 05:57:49 +0000 (22:57 -0700)
__get_unaligned_cpu32() is deprecated.  So, replace it with the more
generic get_unaligned() and just cast the input parameter.

Link: https://lkml.kernel.org/r/20250603132121.3674066-1-julian@outer-limits.org
Signed-off-by: Julian Vetter <julian@outer-limits.org>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Wei-Hsin Yeh <weihsinyeh168@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
include/linux/jhash.h

index fa26a2dd3b52d9a8109d38dac1271837d8b23d33..7c1c1821c694f377ea40adaf6464cf4221ac4d4c 100644 (file)
@@ -24,7 +24,7 @@
  * Jozsef
  */
 #include <linux/bitops.h>
-#include <linux/unaligned/packed_struct.h>
+#include <linux/unaligned.h>
 
 /* Best hash sizes are of power of two */
 #define jhash_size(n)   ((u32)1<<(n))
@@ -77,9 +77,9 @@ static inline u32 jhash(const void *key, u32 length, u32 initval)
 
        /* All but the last block: affect some 32 bits of (a,b,c) */
        while (length > 12) {
-               a += __get_unaligned_cpu32(k);
-               b += __get_unaligned_cpu32(k + 4);
-               c += __get_unaligned_cpu32(k + 8);
+               a += get_unaligned((u32 *)k);
+               b += get_unaligned((u32 *)(k + 4));
+               c += get_unaligned((u32 *)(k + 8));
                __jhash_mix(a, b, c);
                length -= 12;
                k += 12;