From 356a6df12a0de67bdafb598dc998b3663f85cd8f Mon Sep 17 00:00:00 2001 From: Steve Muckle Date: Tue, 31 Oct 2017 13:50:22 -0700 Subject: [PATCH 10/20] vDSO/parse_vdso: fix build issues Fix a couple build issues in vdso_test. (cherry picked from commit 460c35540cb41d20e6c9383e35321995cbd645ca) Signed-off-by: Steve Muckle --- tools/testing/selftests/vDSO/parse_vdso.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/vDSO/parse_vdso.c b/tools/testing/selftests/vDSO/parse_vdso.c index 413f75620a35..945d4e63296a 100644 --- a/tools/testing/selftests/vDSO/parse_vdso.c +++ b/tools/testing/selftests/vDSO/parse_vdso.c @@ -56,13 +56,16 @@ static struct vdso_info } vdso_info; /* Straight from the ELF specification. */ -static unsigned long elf_hash(const unsigned char *name) +static unsigned long elf_hash(const char *s_name) { unsigned long h = 0, g; + const unsigned char *name = (const unsigned char *)s_name; + while (*name) { h = (h << 4) + *name++; - if (g = h & 0xf0000000) + g = h & 0xf0000000; + if (g) h ^= g >> 24; h &= ~g; } -- 2.42.0.609.gbb76f46606-goog