From patchwork Wed Apr 29 14:09:24 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Yan X-Patchwork-Id: 220321 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 58DC3C83004 for ; Wed, 29 Apr 2020 14:10:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 43F062184D for ; Wed, 29 Apr 2020 14:10:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728119AbgD2OKT (ORCPT ); Wed, 29 Apr 2020 10:10:19 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:3341 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726691AbgD2OKT (ORCPT ); Wed, 29 Apr 2020 10:10:19 -0400 Received: from DGGEMS413-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id C86CD686A7DCC01E1F55; Wed, 29 Apr 2020 22:10:12 +0800 (CST) Received: from huawei.com (10.175.124.28) by DGGEMS413-HUB.china.huawei.com (10.3.19.213) with Microsoft SMTP Server id 14.3.487.0; Wed, 29 Apr 2020 22:09:58 +0800 From: Jason Yan To: , , , , , CC: Jason Yan Subject: [PATCH] rtlwifi: remove comparison of 0/1 to bool variable Date: Wed, 29 Apr 2020 22:09:24 +0800 Message-ID: <20200429140924.7750-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: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org The variable 'rtlpriv->rfkill.rfkill_state' is bool and can directly assigned to bool values. Fix the following coccicheck warning: drivers/net/wireless/realtek/rtlwifi/core.c:1725:14-42: WARNING: Comparison of 0/1 to bool variable Signed-off-by: Jason Yan --- drivers/net/wireless/realtek/rtlwifi/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/wireless/realtek/rtlwifi/core.c b/drivers/net/wireless/realtek/rtlwifi/core.c index f73e690bbe8e..4dd82c6052f0 100644 --- a/drivers/net/wireless/realtek/rtlwifi/core.c +++ b/drivers/net/wireless/realtek/rtlwifi/core.c @@ -1722,7 +1722,7 @@ static void rtl_op_rfkill_poll(struct ieee80211_hw *hw) "wireless radio switch turned %s\n", radio_state ? "on" : "off"); - blocked = (rtlpriv->rfkill.rfkill_state == 1) ? 0 : 1; + blocked = !rtlpriv->rfkill.rfkill_state; wiphy_rfkill_set_hw_state(hw->wiphy, blocked); } }