Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp4051858ybb; Mon, 13 Apr 2020 22:44:32 -0700 (PDT) X-Google-Smtp-Source: APiQypIJOOxtLg6quWJJd26dGVlIMz38ovpjSH+gVrSjT1ChhFQMeWWEaGr15wuu78h9TJAZ/vAY X-Received: by 2002:a50:950a:: with SMTP id u10mr8255540eda.45.1586843072028; Mon, 13 Apr 2020 22:44:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586843072; cv=none; d=google.com; s=arc-20160816; b=Wjf187+xt+I0ENW6RRWyLcCmoS3iUWfSeQm9fpFd+whSw/wAgl4K5ZRGVg4KxGFWIz nu+IvxA1mtt1ON/KSdCMkgbnBNs1rmLoUefBW0u++ZhVpzWlNmRFydghNouZNZyVFX+K /OBydOaxKWUfyYF+0JPWB/wrXcRUcqYJ0AmtLUQqIMQzhpSfFxFc+nmEqAFGBSaDxLkE uhopd4xFF1PxfKmqexT8NSekowaR2wHw28Lf252NTKN8RjI+3FwU+dBYePPVYvxCqF1o +QEhsBxBboADM+i2pVQV2D0WHUakCa24tFdwaURD+7YXB4wHUkSV7oOH8Kj5zK9Ii3aT VH6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from; bh=hL+xtgm1m8SFFfOUQkJQnaeFqpNytov30+UxFs0pHcU=; b=ahauApZwpK4pMcormlLWPzMiR/+QtI3v3i23nig/C7HcDgBUMRq5KGTenyOu0LePIe OQ/3mVGIjJzm4Wvr6cIPJX6nAdVuFdRmtPZ5xj1NRssSZxyokUt4hapiI8yCkyveoFIT 0pWL8ZNUhXNCuN/T+zbMFn3KgJ/qrsnQ5mzBnMabPJQplSSVDNRf3L5mqbXCr/edtzmf rOiXqo+mLsaovHVHhOjnkctcy0dO3a5S2QcxzIriPdgyViVK5vxHJmeCfBcD5T6uiM8+ gASSBEk0Oh8+SAEIVgG8TxO+X5c1rNdLhFqvnhf173aRfUZ5xPIorPBNci70bNFp7Xb5 6z5Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for 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 rs10si6772469ejb.288.2020.04.13.22.44.08; Mon, 13 Apr 2020 22:44:32 -0700 (PDT) Received-SPF: pass (google.com: best guess record for 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: best guess record for 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 S1729235AbgDMLvu (ORCPT + 99 others); Mon, 13 Apr 2020 07:51:50 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:60498 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729178AbgDMLvu (ORCPT ); Mon, 13 Apr 2020 07:51:50 -0400 Received: from DGGEMS411-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 79E6F4CF4FE89C54BBF1; Mon, 13 Apr 2020 19:51:47 +0800 (CST) Received: from linux-lmwb.huawei.com (10.175.103.112) by DGGEMS411-HUB.china.huawei.com (10.3.19.211) with Microsoft SMTP Server id 14.3.487.0; Mon, 13 Apr 2020 19:51:41 +0800 From: Zou Wei To: , , , , , , , , , , CC: Zou Wei Subject: [PATCH-next] bpf: Verifier, remove unneeded conversion to bool Date: Mon, 13 Apr 2020 19:57:56 +0800 Message-ID: <1586779076-101346-1-git-send-email-zou_wei@huawei.com> X-Mailer: git-send-email 2.6.2 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.175.103.112] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This issue was detected by using the Coccinelle software: kernel/bpf/verifier.c:1259:16-21: WARNING: conversion to bool not needed here The conversion to bool is unneeded, remove it Reported-by: Hulk Robot Signed-off-by: Zou Wei --- kernel/bpf/verifier.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c index 04c6630..38cfcf7 100644 --- a/kernel/bpf/verifier.c +++ b/kernel/bpf/verifier.c @@ -1255,8 +1255,7 @@ static void __mark_reg_unknown(const struct bpf_verifier_env *env, reg->type = SCALAR_VALUE; reg->var_off = tnum_unknown; reg->frameno = 0; - reg->precise = env->subprog_cnt > 1 || !env->allow_ptr_leaks ? - true : false; + reg->precise = env->subprog_cnt > 1 || !env->allow_ptr_leaks; __mark_reg_unbounded(reg); } -- 2.6.2