From patchwork Sun Apr 26 09:41:15 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Yan X-Patchwork-Id: 11510335 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D5E271392 for ; Sun, 26 Apr 2020 09:42:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C76692087E for ; Sun, 26 Apr 2020 09:42:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726436AbgDZJmB (ORCPT ); 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 X-Originating-IP: [10.175.124.28] X-CFilter-Loop: Reflected Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@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); }