From: Julian Vetter <julian@outer-limits.org>
To: Peter Zijlstra <peterz@infradead.org>,
Ingo Molnar <mingo@redhat.com>,
Arnaldo Carvalho de Melo <acme@kernel.org>,
Namhyung Kim <namhyung@kernel.org>,
Mark Rutland <mark.rutland@arm.com>,
Alexander Shishkin <alexander.shishkin@linux.intel.com>,
Jiri Olsa <jolsa@kernel.org>, Ian Rogers <irogers@google.com>,
Adrian Hunter <adrian.hunter@intel.com>,
"Liang, Kan" <kan.liang@linux.intel.com>,
"Jason A. Donenfeld" <Jason@zx2c4.com>,
Christophe Leroy <christophe.leroy@csgroup.eu>,
Al Viro <viro@zeniv.linux.org.uk>
Cc: linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org,
Julian Vetter <julian@outer-limits.org>
Subject: [PATCH RESEND 3/5] tools: Replace __get_unaligned_cpu32 in jhash function
Date: Mon, 7 Jul 2025 14:24:58 +0200 [thread overview]
Message-ID: <20250707122500.724699-4-julian@outer-limits.org> (raw)
In-Reply-To: <20250707122500.724699-1-julian@outer-limits.org>
The __get_unaligned_cpu32 function is deprecated. So, replace it with
the more generic get_unaligned and just cast the input parameter.
Signed-off-by: Julian Vetter <julian@outer-limits.org>
---
tools/include/linux/jhash.h | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/tools/include/linux/jhash.h b/tools/include/linux/jhash.h
index af8d0fe1c6ce..5ff3c8275281 100644
--- a/tools/include/linux/jhash.h
+++ b/tools/include/linux/jhash.h
@@ -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;
--
2.34.1
next prev parent reply other threads:[~2025-07-07 12:28 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-07 12:24 [PATCH RESEND 0/5] Remove remaining __get_unaligned_cpu32 Julian Vetter
2025-07-07 12:24 ` [PATCH RESEND 1/5] Replace __get_unaligned_cpu32 in jhash function Julian Vetter
2025-07-07 12:24 ` [PATCH RESEND 2/5] Remove unaligned/packed_struct.h header Julian Vetter
2025-07-07 12:24 ` Julian Vetter [this message]
2025-07-07 12:24 ` [PATCH RESEND 4/5] tools: " Julian Vetter
2025-07-07 12:25 ` [PATCH RESEND 5/5] tools: Remove the check for packed_struct.h header Julian Vetter
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250707122500.724699-4-julian@outer-limits.org \
--to=julian@outer-limits.org \
--cc=Jason@zx2c4.com \
--cc=acme@kernel.org \
--cc=adrian.hunter@intel.com \
--cc=alexander.shishkin@linux.intel.com \
--cc=christophe.leroy@csgroup.eu \
--cc=irogers@google.com \
--cc=jolsa@kernel.org \
--cc=kan.liang@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=mingo@redhat.com \
--cc=namhyung@kernel.org \
--cc=peterz@infradead.org \
--cc=viro@zeniv.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).