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: <229F1668-2FE9-4B09-8314-DFB13B3D0A12@fb.com>
Date:   Fri, 14 Jan 2022 00:37:37 +0000
From:   Song Liu <songliubraving@...com>
To:     "davidcomponentone@...il.com" <davidcomponentone@...il.com>
CC:     Alexei Starovoitov <ast@...nel.org>,
        Daniel Borkmann <daniel@...earbox.net>,
        "andrii@...nel.org" <andrii@...nel.org>, Martin Lau <kafai@...com>,
        Yonghong Song <yhs@...com>,
        "john.fastabend@...il.com" <john.fastabend@...il.com>,
        "kpsingh@...nel.org" <kpsingh@...nel.org>,
        "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
        "bpf@...r.kernel.org" <bpf@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        Yang Guang <yang.guang5@....com.cn>,
        "Zeal Robot" <zealci@....com.cn>
Subject: Re: [PATCH] libbpf: remove unneeded conversion to bool



> On Jan 13, 2022, at 4:07 PM, davidcomponentone@...il.com wrote:
> 
> From: Yang Guang <yang.guang5@....com.cn>
> 
> The coccinelle report
> ./tools/lib/bpf/libbpf.c:1653:43-48:
> WARNING: conversion to bool not needed here
> 
> Relational and logical operators evaluate to bool,
> explicit conversion is overly verbose and unneeded.
> 
> Reported-by: Zeal Robot <zealci@....com.cn>
> Signed-off-by: Yang Guang <yang.guang5@....com.cn>
> Signed-off-by: David Yang <davidcomponentone@...il.com>

I think this change has been NACK'ed multiple times. 

I guess it is a good idea NOT to send it again. 

Thanks,
Song

> ---
> 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 7f10dd501a52..f87787608795 100644
> --- a/tools/lib/bpf/libbpf.c
> +++ b/tools/lib/bpf/libbpf.c
> @@ -1650,7 +1650,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')
> -- 
> 2.30.2
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ