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]
Date: Sat, 2 Mar 2024 08:59:08 -0800
From: Yonghong Song <yonghong.song@...ux.dev>
To: Thorsten Blum <thorsten.blum@...lux.com>,
 Alexei Starovoitov <ast@...nel.org>, Daniel Borkmann <daniel@...earbox.net>,
 Andrii Nakryiko <andrii@...nel.org>
Cc: Martin KaFai Lau <martin.lau@...ux.dev>, Song Liu <song@...nel.org>,
 John Fastabend <john.fastabend@...il.com>, KP Singh <kpsingh@...nel.org>,
 Stanislav Fomichev <sdf@...gle.com>, Hao Luo <haoluo@...gle.com>,
 Jiri Olsa <jolsa@...nel.org>, bpf@...r.kernel.org,
 linux-kernel@...r.kernel.org
Subject: Re: [PATCH] libbpf: Remove unneeded conversion to bool


On 3/1/24 4:54 PM, Thorsten Blum wrote:
> Fixes Coccinelle/coccicheck warning reported by boolconv.cocci.
>
> Signed-off-by: Thorsten Blum <thorsten.blum@...lux.com>

See
   https://lore.kernel.org/bpf/229F1668-2FE9-4B09-8314-DFB13B3D0A12@fb.com/

This has been discussed multiple times and recommendation is to keep it as is.

> ---
>   tools/lib/bpf/libbpf.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tools/lib/bpf/libbpf.c b/tools/lib/bpf/libbpf.c
> index afd09571c482..2dda7a6c6f85 100644
> --- a/tools/lib/bpf/libbpf.c
> +++ b/tools/lib/bpf/libbpf.c
> @@ -1801,7 +1801,7 @@ static int set_kcfg_value_tri(struct extern_desc *ext, void *ext_val,
>   				ext->name, value);
>   			return -EINVAL;
>   		}
> -		*(bool *)ext_val = value == 'y' ? true : false;
> +		*(bool *)ext_val = value == 'y';
>   		break;
>   	case KCFG_TRISTATE:
>   		if (value == 'y')

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ