Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp1717461ybz; Sun, 26 Apr 2020 02:44:45 -0700 (PDT) X-Google-Smtp-Source: APiQypJ4OITohHmyHxP/rf1GEdlkOiu/ntBnL/Qc6oUfM4q65RKMxVPVQ3fXqBePmFiogVKi60Tt X-Received: by 2002:a17:907:2101:: with SMTP id qn1mr15391683ejb.207.1587894285284; Sun, 26 Apr 2020 02:44:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587894285; cv=none; d=google.com; s=arc-20160816; b=PLVLUh7V33bofPm9M40cCn1XvNjvUrTEoXKOUp0jX5+bNtFAhlvSuAqT1UDOf0hMIF NLg+x5QmQUI6RYFRYt3Bw+9O8TvlsVqM+kgvR/0XI4uIyhEV7MO6Np2LyCYFGYSbxKps 6s3LpIOJLuUO8kX7rbUo9HWswNNMbRwuQGScsmzafzWCrD0mbFeVk4zgJ5dMq8SMdYpK BqqzutFP2zuMe0VspJiPt94vPkHvCOeWOnpnRGhdHRyy/uC3YvmICt2pDFiEW5Y6jBWg dd1AOc7aFH3FXuuRw7ywgCCpyyT6vXJsmfaRxSy42p7/J1nox/xKFqFjGwe61nkffDbd R8eA== 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=w81iEpi+hnI5EfuokyFIXPQpd+ZpUZDmPcuyEhghtes=; b=TVpjHxFtLwD8Um6ZBUYOE5ZIDuxq/FIKxrOwfnRk5YnSsO+VfnhmpWb2BbFRL746a/ Srph4/6tFFHKtAUabHJGcLwOg2rUXDM2OJRd1NxVaTjnoyQ3SD/bTDEIXiVZQ5DcaWLW 8vhnCPNiekgKKtS5gVGR6ueFXKJgT/wuqthEt9vASDQFOxw4l212iFW5OOiDpiKIRZb3 BBzGvul5cPrgIGpViuuFEaeamPXO8XK6G2yAcy1ahNQTWj9u1rvLW1YIiMWOZftHD8Ei 0nNBGDr30tPGI7z2iIdYvzmWBfGXfNE4yvbv4UKeD9hDIf3kogxoiJOecaEe9GDUvWIO KYXw== 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 c12si6109296edr.596.2020.04.26.02.44.22; Sun, 26 Apr 2020 02:44:45 -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 S1726444AbgDZJmB (ORCPT + 99 others); Sun, 26 Apr 2020 05:42:01 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:39862 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726162AbgDZJmB (ORCPT ); Sun, 26 Apr 2020 05:42:01 -0400 Received: from DGGEMS409-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 973BDE765C8766C2211B; Sun, 26 Apr 2020 17:41:59 +0800 (CST) Received: from huawei.com (10.175.124.28) by DGGEMS409-HUB.china.huawei.com (10.3.19.209) with Microsoft SMTP Server id 14.3.487.0; Sun, 26 Apr 2020 17:41:49 +0800 From: Jason Yan To: , , , , , CC: Jason Yan Subject: [PATCH] rtlwifi: use true,false for bool variable in rtl_init_rfkill() Date: Sun, 26 Apr 2020 17:41:15 +0800 Message-ID: <20200426094115.23294-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 'blocked' is a bool variable, and '==' expression itself is bool too. So no need to convert it to 0/1. This fixes the following coccicheck warning: drivers/net/wireless/realtek/rtlwifi/base.c:508:13-41: WARNING: Comparison of 0/1 to bool variable Signed-off-by: Jason Yan --- drivers/net/wireless/realtek/rtlwifi/base.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/wireless/realtek/rtlwifi/base.c b/drivers/net/wireless/realtek/rtlwifi/base.c index c75192c4447f..a4489b9302d4 100644 --- a/drivers/net/wireless/realtek/rtlwifi/base.c +++ b/drivers/net/wireless/realtek/rtlwifi/base.c @@ -505,7 +505,7 @@ void rtl_init_rfkill(struct ieee80211_hw *hw) rtlpriv->rfkill.rfkill_state = radio_state; - blocked = (rtlpriv->rfkill.rfkill_state == 1) ? 0 : 1; + blocked = rtlpriv->rfkill.rfkill_state != 1; wiphy_rfkill_set_hw_state(hw->wiphy, blocked); } -- 2.21.1