lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <Ya45Q9hLPIaociYW@archlinux-ax161>
Date:   Mon, 6 Dec 2021 09:24:35 -0700
From:   Nathan Chancellor <nathan@...nel.org>
To:     Anders Roxell <anders.roxell@...aro.org>
Cc:     shuah@...nel.org, ndesaulniers@...gle.com,
        linux-kselftest@...r.kernel.org, linux-kernel@...r.kernel.org,
        llvm@...ts.linux.dev
Subject: Re: [PATCH v2] selftests: vDSO: parse: warning: fix assignment as a
 condition

On Mon, Dec 06, 2021 at 11:29:31AM +0100, Anders Roxell wrote:
> When building selftests/vDSO with clang the following warning shows up:
> 
> clang -std=gnu99 -Wno-pointer-sign vdso_test_gettimeofday.c parse_vdso.c \
>       -o /tmp/kselftest/vDSO/vdso_test_gettimeofday
> parse_vdso.c:65:9: warning: using the result of an assignment as a condition without parentheses [-Wparentheses]
>                 if (g = h & 0xf0000000)
>                     ~~^~~~~~~~~~~~~~~~
> 
> Rework to a parentheses before doing the check.

This part of the commit message does not line up with what you are
actually doing now.

> Signed-off-by: Anders Roxell <anders.roxell@...aro.org>
> Reviewed-by: Nick Desaulniers <ndesaulniers@...gle.com>

With that fixed:

Reviewed-by: Nathan Chancellor <nathan@...nel.org>

> ---
> 
> v1 -> v2: fixed checkpatch warnings
> 
>  tools/testing/selftests/vDSO/parse_vdso.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/tools/testing/selftests/vDSO/parse_vdso.c b/tools/testing/selftests/vDSO/parse_vdso.c
> index 413f75620a35..fdd38f7e0e43 100644
> --- a/tools/testing/selftests/vDSO/parse_vdso.c
> +++ b/tools/testing/selftests/vDSO/parse_vdso.c
> @@ -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 (g)
>  			h ^= g >> 24;
>  		h &= ~g;
>  	}
> -- 
> 2.33.0
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ