From patchwork Mon May 10 12:43:15 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Leizhen \(ThunderTown\)" X-Patchwork-Id: 433141 Delivered-To: patch@linaro.org Received: by 2002:a02:c901:0:0:0:0:0 with SMTP id t1csp2882557jao; Mon, 10 May 2021 07:12:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzddsxgAnP3ZqS63kAXi+2C6btE78lwwAauaXYcjKiWzjzzZXkOjSUsZK/VUZIA2t/GopI4 X-Received: by 2002:a05:6638:2643:: with SMTP id n3mr21574439jat.104.1620655932541; Mon, 10 May 2021 07:12:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620655932; cv=none; d=google.com; s=arc-20160816; b=vqja5pLimR2gTFLw64k39qZHWT8AgOa8YIwN55l2UUne1zGYIm8SJnTZsZGZsiQi/+ e1sXFuF1SNn46tHleKMZVy/qMY9dct65XsXlLGv5BKZl8TAI/fCdCUdpJY5uCb2WcC5F xXt1zsbWZzLrvWU6CPAw9smlZ/QHjfGrgRxYi/LLy9adusKXP9+oRIyp25FlQTqEefQS 4qJcqS9fIXrM2cBp0tSMFh0SBHUP3ZbcoahXscnwXfZ+9n42E2dwmdUB+sPC1aQ73FfD fqduaY0xf87gGB6GuGujgxhyu+bfn7iqAETRcREU2WevOzlEAgLF4hrCzdlnu9mf8EhT BayQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=aEqAYECPXbwtutIBNh8oFDFQiVvlPmBu4mSGy8eDsg8=; b=ug7W75GlZs1OYN1mcyzIaZqOivVa9KJNQaQL/xqMi5zuhJWMK1yZ0vgHc3d2gAsokq wYNnGezhRxjE6o/cP8wmE9t697aC7Z2yNUFIF4lCbKTzY7mAm7bWgKqutfJTWRnqUqyI 3FcR7oRdugzkZ0hum6TUUeyeymUM0Yuoe2p2jHwz/uaKDP2VBzpyCJoz7hQIrEbsrYMY Zx/SZBONxE/WYYkDD9gFHs1kzYRA3i0SAAc42yWeu14U3J1qjl8ahAi/bzXy8CldNS3j RiRcsJ2fx/GywY6FN0pVpsvn52YclnEgRyfXJHJWmjXO6Hpninm1QaFZE3/0OfjzKaD8 g3cg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q8si16406157ior.12.2021.05.10.07.12.11; Mon, 10 May 2021 07:12:12 -0700 (PDT) Received-SPF: pass (google.com: domain of netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235704AbhEJNlX (ORCPT + 8 others); Mon, 10 May 2021 09:41:23 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:2673 "EHLO szxga04-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241419AbhEJMol (ORCPT ); Mon, 10 May 2021 08:44:41 -0400 Received: from DGGEMS409-HUB.china.huawei.com (unknown [172.30.72.59]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4Ff0yn6n6Cz1BKPR; Mon, 10 May 2021 20:40:49 +0800 (CST) Received: from thunder-town.china.huawei.com (10.174.177.72) by DGGEMS409-HUB.china.huawei.com (10.3.19.209) with Microsoft SMTP Server id 14.3.498.0; Mon, 10 May 2021 20:43:19 +0800 From: Zhen Lei To: Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , netdev , bpf CC: Zhen Lei Subject: [PATCH 1/1] libbpf: Delete an unneeded bool conversion Date: Mon, 10 May 2021 20:43:15 +0800 Message-ID: <20210510124315.3854-1-thunder.leizhen@huawei.com> X-Mailer: git-send-email 2.26.0.windows.1 MIME-Version: 1.0 X-Originating-IP: [10.174.177.72] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org 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 --- tools/lib/bpf/libbpf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.26.0.106.g9fadedd 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')