All of lore.kernel.org
 help / color / mirror / Atom feed
From: Song Liu <songliubraving@fb.com>
To: "davidcomponentone@gmail.com" <davidcomponentone@gmail.com>
Cc: Alexei Starovoitov <ast@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	"andrii@kernel.org" <andrii@kernel.org>,
	Martin Lau <kafai@fb.com>, Yonghong Song <yhs@fb.com>,
	"john.fastabend@gmail.com" <john.fastabend@gmail.com>,
	"kpsingh@kernel.org" <kpsingh@kernel.org>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"bpf@vger.kernel.org" <bpf@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Yang Guang <yang.guang5@zte.com.cn>,
	"Zeal Robot" <zealci@zte.com.cn>
Subject: Re: [PATCH] libbpf: remove unneeded conversion to bool
Date: Fri, 14 Jan 2022 00:37:37 +0000	[thread overview]
Message-ID: <229F1668-2FE9-4B09-8314-DFB13B3D0A12@fb.com> (raw)
In-Reply-To: <2010e0898586ad83321e8d84181789123e2fe4e4.1642062557.git.davidcomponentone@gmail.com>



> On Jan 13, 2022, at 4:07 PM, davidcomponentone@gmail.com wrote:
> 
> From: Yang Guang <yang.guang5@zte.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@zte.com.cn>
> Signed-off-by: Yang Guang <yang.guang5@zte.com.cn>
> Signed-off-by: David Yang <davidcomponentone@gmail.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
> 


  reply	other threads:[~2022-01-14  0:37 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-14  0:07 [PATCH] libbpf: remove unneeded conversion to bool davidcomponentone
2022-01-14  0:37 ` Song Liu [this message]
  -- strict thread matches above, loose matches on Subject: below --
2024-03-02  0:54 [PATCH] libbpf: Remove " Thorsten Blum
2024-03-02 16:59 ` Yonghong Song
2021-11-25  0:54 [PATCH] libbpf: remove " davidcomponentone
2021-11-25 23:12 ` Daniel Borkmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=229F1668-2FE9-4B09-8314-DFB13B3D0A12@fb.com \
    --to=songliubraving@fb.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=davidcomponentone@gmail.com \
    --cc=john.fastabend@gmail.com \
    --cc=kafai@fb.com \
    --cc=kpsingh@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=yang.guang5@zte.com.cn \
    --cc=yhs@fb.com \
    --cc=zealci@zte.com.cn \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.