diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-08-07 13:16:15 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-08-07 13:16:15 +0000 |
commit | b5d465a24babe0dbb7438a7ef28eb29a933de302 (patch) | |
tree | 7a1e797d75fc2668c2bead5c19f93e472d57a5e1 /tools/testing/selftests/vDSO/parse_vdso.c | |
parent | Releasing progress-linux version 6.9.10-1~progress7.99u1. (diff) | |
download | linux-b5d465a24babe0dbb7438a7ef28eb29a933de302.tar.xz linux-b5d465a24babe0dbb7438a7ef28eb29a933de302.zip |
Merging upstream version 6.9.11.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tools/testing/selftests/vDSO/parse_vdso.c')
-rw-r--r-- | tools/testing/selftests/vDSO/parse_vdso.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/tools/testing/selftests/vDSO/parse_vdso.c b/tools/testing/selftests/vDSO/parse_vdso.c index 413f75620a..4ae417372e 100644 --- a/tools/testing/selftests/vDSO/parse_vdso.c +++ b/tools/testing/selftests/vDSO/parse_vdso.c @@ -55,14 +55,20 @@ static struct vdso_info ELF(Verdef) *verdef; } vdso_info; -/* Straight from the ELF specification. */ -static unsigned long elf_hash(const unsigned char *name) +/* + * Straight from the ELF specification...and then tweaked slightly, in order to + * avoid a few clang warnings. + */ +static unsigned long elf_hash(const char *name) { unsigned long h = 0, g; - while (*name) + const unsigned char *uch_name = (const unsigned char *)name; + + while (*uch_name) { - h = (h << 4) + *name++; - if (g = h & 0xf0000000) + h = (h << 4) + *uch_name++; + g = h & 0xf0000000; + if (g) h ^= g >> 24; h &= ~g; } |