Received: by 2002:a25:23cc:0:0:0:0:0 with SMTP id j195csp1886627ybj; Wed, 6 May 2020 07:09:28 -0700 (PDT) X-Google-Smtp-Source: APiQypL9K5sNA8zGwTKipdate6JJj40aZx0/EuDSQ8TliZ/TFIgN8OzcZowWlo39iBA4B3ToDfjg X-Received: by 2002:aa7:cd06:: with SMTP id b6mr6824446edw.67.1588774167977; Wed, 06 May 2020 07:09:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588774167; cv=none; d=google.com; s=arc-20160816; b=HSZHYE0NJWSwa59qVJfJSHPL2JI/NcXmv9rESs09uvS1u04iq18/jkWq6ijDUOdcOL C/beI4hQNPRGfvP52txLCIbTiDWP2EAxm5qgslnR2Edq9/UVrwXk/HSdNNrN2I2LAqnZ R210RfYu/ETQIaDRZUrBPm/6UkgPhPu7wQRUCH6HtBKJVtnl+j9sdJNbAWSn/Rxd8fzp ooyH0aycquY8n0cN/4cMhNrgcrWTmDyV6m+q/f+dyVrMhhxBChMWwWXOjtTgYqcfzdOA SIsrE3b3qVNpb5MfpaWnxBgPZD4bGKj+WZBgkBPujvr8ZCINbAgONFqTLAwMDlWdIn0y Xkhw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=XdLZaem5uq0gX2TOZ02MC4xqATgAD4ZgRqLUzW6Jpes=; b=qgk7/UhLvCKOXnJKIKI2P/GTkLYM5ininDUk3NZ3HpzH6Pm22lzp2YSyAJJ9NgJnVK xxQwRasqgSpk3rPl8jOx1npZmqLWEYHG6W9MvCY8xxP5PK733fhTqDRoc+coZjxhtVf9 udCmPk0VbbrU1F2uW3XSdPQeo93GQ6pNOFEkAydKG9S490vIkrJPi0DXb2XZbMthh4ua KZF/QzWQDYsQN8KxvqCc9+DgW2CJXsbQjcWZAz2P9/Wd3pZwhZaL1//mmIw5T9zHbeX7 4gduZVMf6ncBhs69B2fPcs6pC2h13woK5Ppr44r1kjSvtx/LgK4RW3nsAafEhuYtZbrK Jw9w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v28si1036552edx.335.2020.05.06.07.09.03; Wed, 06 May 2020 07:09:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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 linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728921AbgEFOEp (ORCPT + 99 others); Wed, 6 May 2020 10:04:45 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:37996 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726268AbgEFOEp (ORCPT ); Wed, 6 May 2020 10:04:45 -0400 Received: from DGGEMS403-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 9BDB53F1DD6459DB08CA; Wed, 6 May 2020 22:04:42 +0800 (CST) Received: from huawei.com (10.175.124.28) by DGGEMS403-HUB.china.huawei.com (10.3.19.203) with Microsoft SMTP Server id 14.3.487.0; Wed, 6 May 2020 22:04:35 +0800 From: Jason Yan To: , , , , , , , , , , , , , , , , , , , , , CC: Jason Yan Subject: [PATCH v2] bpf, i386: remove unneeded conversion to bool Date: Wed, 6 May 2020 22:03:52 +0800 Message-ID: <20200506140352.37154-1-yanaijie@huawei.com> X-Mailer: git-send-email 2.21.1 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.175.124.28] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The '==' expression itself is bool, no need to convert it to bool again. This fixes the following coccicheck warning: arch/x86/net/bpf_jit_comp32.c:1478:50-55: WARNING: conversion to bool not needed here arch/x86/net/bpf_jit_comp32.c:1479:50-55: WARNING: conversion to bool not needed here Signed-off-by: Jason Yan --- v2: change the name 'x32' to 'i386'. arch/x86/net/bpf_jit_comp32.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/x86/net/bpf_jit_comp32.c b/arch/x86/net/bpf_jit_comp32.c index 66cd150b7e54..96fde03aa987 100644 --- a/arch/x86/net/bpf_jit_comp32.c +++ b/arch/x86/net/bpf_jit_comp32.c @@ -1475,8 +1475,8 @@ static int do_jit(struct bpf_prog *bpf_prog, int *addrs, u8 *image, for (i = 0; i < insn_cnt; i++, insn++) { const s32 imm32 = insn->imm; const bool is64 = BPF_CLASS(insn->code) == BPF_ALU64; - const bool dstk = insn->dst_reg == BPF_REG_AX ? false : true; - const bool sstk = insn->src_reg == BPF_REG_AX ? false : true; + const bool dstk = insn->dst_reg != BPF_REG_AX; + const bool sstk = insn->src_reg != BPF_REG_AX; const u8 code = insn->code; const u8 *dst = bpf2ia32[insn->dst_reg]; const u8 *src = bpf2ia32[insn->src_reg]; -- 2.21.1