From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DC5E8C433ED for ; Tue, 11 May 2021 05:09:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9EF5461927 for ; Tue, 11 May 2021 05:09:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230314AbhEKFKV (ORCPT ); Tue, 11 May 2021 01:10:21 -0400 Received: from mail.kernel.org ([198.145.29.99]:57440 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229885AbhEKFKV (ORCPT ); Tue, 11 May 2021 01:10:21 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 6D393616EA; Tue, 11 May 2021 05:09:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1620709755; bh=fE6IHU6HUZqvj0DH4qQyG0H9jxoUolUyzkfVi9rdSXw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=fPj/JZxOb5RaYxqCFcGcckN3QhutAofMPnU2uy3no5CrA5RyPYyx+YgUnGKvTj996 IKbmfxmaJ89l22MWOIMoM1+9yiJlWtHmGHd1rerS6lEm7rJ8SzjP9AT9QrScLGPbB7 47k72ZXVrr/hhSo05IRPajK+Jl7+39vjJog/n8xAQEILUST8NqFl2u57f0IqP2sWMp zIiIFJfva9ZMMFhyfcsLzEb8jD1eWDG6ERKuMytIi1qvux1lbAlKfKhYE3HTKhRAiC idZE6Hj0LtfsjB63xnTJl8VFbsLuKtxJgZot4jOZLXGOwP06kr6zrEqe3ygWitbrjx hpIXFh3eLY6+w== Date: Tue, 11 May 2021 08:09:11 +0300 From: Leon Romanovsky To: Andrii Nakryiko Cc: Zhen Lei , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , netdev , bpf Subject: Re: [PATCH 1/1] libbpf: Delete an unneeded bool conversion Message-ID: References: <20210510124315.3854-1-thunder.leizhen@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Mon, May 10, 2021 at 11:00:29AM -0700, Andrii Nakryiko wrote: > On Mon, May 10, 2021 at 5:43 AM Zhen Lei wrote: > > > > The result of an expression consisting of a single relational operator is > > already of the bool type and does not need to be evaluated explicitly. > > > > No functional change. > > > > Signed-off-by: Zhen Lei > > --- > > See [0] and [1]. > > [0] https://lore.kernel.org/bpf/CAEf4BzYgLf5g3oztbA-CJR4gQ7AVKQAGrsHWCOgTtUMUM-Mxfg@mail.gmail.com/ > [1] https://lore.kernel.org/bpf/CAEf4BzZQ6=-h3g1duXFwDLr92z7nE6ajv8Rz_Zv=qx=-F3sRVA@mail.gmail.com/ How long do you plan to fight with such patches? Thanks > > > 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 e2a3cf4378140f2..fa02213c451f4d2 100644 > > --- a/tools/lib/bpf/libbpf.c > > +++ b/tools/lib/bpf/libbpf.c > > @@ -1504,7 +1504,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.26.0.106.g9fadedd > > > >