FROMLIST: selftests/vDSO: Fix assignment in condition without parentheses

Fixes clang compiler warnings by adding parentheses:

parse_vdso.c:65:9: warning: using the result of an assignment as a
 condition without parentheses [-Wparentheses]
                if (g = h & 0xf0000000)
                    ~~^~~~~~~~~~~~~~~~
parse_vdso.c:65:9: note: place parentheses around the assignment to
 silence this warning
                if (g = h & 0xf0000000)
                      ^
                    (                 )
parse_vdso.c:65:9: note: use '==' to turn this assignment into an
 equality comparison
                if (g = h & 0xf0000000)
                      ^
                      ==

Fixes: 98eedc3a9d ("Document the vDSO and add a reference parser")
Change-Id: I5c0b1ae0f488910f99dfa4e0f363ad0f308fb8ff
Signed-off-by: Edward Liaw <edliaw@google.com>
Link: https://lore.kernel.org/all/20240429203441.143607-1-edliaw@google.com/
This commit is contained in:
Edward Liaw
2024-04-29 20:34:36 +00:00
committed by John Stultz
parent 1c1e9693ca
commit c866527fc2
+2 -1
View File
@@ -62,7 +62,8 @@ static unsigned long elf_hash(const unsigned char *name)
while (*name)
{
h = (h << 4) + *name++;
if (g = h & 0xf0000000)
g = h & 0xf0000000;
if (h)
h ^= g >> 24;
h &= ~g;
}