From patchwork Sun Jan 10 12:15:21 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aditya Srivastava X-Patchwork-Id: 360892 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=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham 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 B0C25C43381 for ; Sun, 10 Jan 2021 12:16:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 962F52071C for ; Sun, 10 Jan 2021 12:16:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726579AbhAJMQV (ORCPT ); Sun, 10 Jan 2021 07:16:21 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41028 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726250AbhAJMQU (ORCPT ); Sun, 10 Jan 2021 07:16:20 -0500 Received: from mail-pg1-x535.google.com (mail-pg1-x535.google.com [IPv6:2607:f8b0:4864:20::535]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 111CAC0617A3; Sun, 10 Jan 2021 04:15:40 -0800 (PST) Received: by mail-pg1-x535.google.com with SMTP id g15so10754642pgu.9; Sun, 10 Jan 2021 04:15:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=iVUpnewCYxAmE3x0Y0aBU2Pf48lHqJK5gRlrTNmnLnw=; b=X03ytBtG1fgBmWRr0i9Y7/VHATIX3ymIHcmtUaQd+ObNkGfvlFja8/7VbQJbyTilQY QtKur3yHjvsIbQHGF4nhkjnihBRAJ4GhqF97E0Sgmu9II61ESzk7qeWByz6V3t93wDrx zkFvZdJ7vT23Kd1cPu+8Jo9BRI6waHtEAasImMPbChLey44H44LLYJVc3Y/NNPOvSANm eo15lPld4J1WmAJ9n9XADAGgYMM2ixtpy4lZ0GOOMBy7EuIP+sGZ86uUZ0QAEeDwfTok Llz9YXHEmfYmyE5Ai/7v9ZnkfMXEUtMh26AzZWK4Bj55XGUzaKObqfQ3Xls3RZhzZlKJ 7skA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=iVUpnewCYxAmE3x0Y0aBU2Pf48lHqJK5gRlrTNmnLnw=; b=cQB2y4K77V9saRdPPgMWKHi8LvIRvWyAsukvaZbmLo2gInylGmzfRyPHiXFKffCYqe rFzy+0KnV+qjFksvQdAO3u5A0HD52QiL83KxnskoebFPA2sAurAQ7ok9yi2qU8wTlfud c8acDVnjRo266rLMyjOPAqMC/8Je+LxEUb/Ix7QaL7xv/FekNWAtUx2ODzDgBZ7CbMdg EYGz+uJQ4kLc8OlTbB9uMy3j7IgNMSS6ywz++l35Y7EXju33L+xMHL/splcV8W0NUNky hyEHW7ORgPUuIgldrFl2RMOJIpW4QSnci/rB0JSFxnjdOzQOQyDGCw85wtuO2EIzRzPK h/vQ== X-Gm-Message-State: AOAM533HZ9ZIFJEaNt4n3j+eNDPg8UsH0b7PSu7H+oVbqmFQYhphoBcJ fqDL4wPTz9HQtC9H9Q+wg4bSqM8k9A9+7l3q X-Google-Smtp-Source: ABdhPJxUnAbYJooToG2g8hLQx/QHqJiwASfde63P/54nWB7MoIg3hAAwGqKEtMAUKUpHuxpNED4zCQ== X-Received: by 2002:a63:545f:: with SMTP id e31mr15536593pgm.327.1610280939279; Sun, 10 Jan 2021 04:15:39 -0800 (PST) Received: from localhost.localdomain ([2405:201:600d:a089:381d:ba42:3c3c:81ce]) by smtp.googlemail.com with ESMTPSA id y5sm10959791pjt.42.2021.01.10.04.15.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 10 Jan 2021 04:15:38 -0800 (PST) From: Aditya Srivastava To: linux-wireless@vger.kernel.org Cc: pkshih@realtek.com, kvalo@codeaurora.org, davem@davemloft.net, kuba@kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kernel-mentees@lists.linuxfoundation.org, lukas.bulwahn@gmail.com, yashsri421@gmail.com Subject: [PATCH 1/5] rtlwifi: rtl_pci: fix bool comparison in expressions Date: Sun, 10 Jan 2021 17:45:21 +0530 Message-Id: <20210110121525.2407-2-yashsri421@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210110121525.2407-1-yashsri421@gmail.com> References: <3c121981-1468-fc9d-7813-483246066cc4@lwfinger.net> <20210110121525.2407-1-yashsri421@gmail.com> Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org There are certain conditional expressions in rtl_pci, where a boolean variable is compared with true/false, in forms such as (foo == true) or (false != bar), which does not comply with checkpatch.pl (CHECK: BOOL_COMPARISON), according to which boolean variables should be themselves used in the condition, rather than comparing with true/false E.g., in drivers/net/wireless/realtek/rtlwifi/ps.c, "if (find_p2p_ie == true)" can be replaced with "if (find_p2p_ie)" Replace all such expressions with the bool variables appropriately Signed-off-by: Aditya Srivastava --- drivers/net/wireless/realtek/rtlwifi/ps.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/realtek/rtlwifi/ps.c b/drivers/net/wireless/realtek/rtlwifi/ps.c index f99882255d48..629c03271bde 100644 --- a/drivers/net/wireless/realtek/rtlwifi/ps.c +++ b/drivers/net/wireless/realtek/rtlwifi/ps.c @@ -798,9 +798,9 @@ static void rtl_p2p_noa_ie(struct ieee80211_hw *hw, void *data, ie += 3 + noa_len; } - if (find_p2p_ie == true) { + if (find_p2p_ie) { if ((p2pinfo->p2p_ps_mode > P2P_PS_NONE) && - (find_p2p_ps_ie == false)) + (!find_p2p_ps_ie)) rtl_p2p_ps_cmd(hw, P2P_PS_DISABLE); } } From patchwork Sun Jan 10 12:15:22 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aditya Srivastava X-Patchwork-Id: 360363 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=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,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 F17E7C4332E for ; Sun, 10 Jan 2021 12:16:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BED5B2071C for ; Sun, 10 Jan 2021 12:16:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726644AbhAJMQZ (ORCPT ); Sun, 10 Jan 2021 07:16:25 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41040 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726250AbhAJMQY (ORCPT ); Sun, 10 Jan 2021 07:16:24 -0500 Received: from mail-pj1-x1031.google.com (mail-pj1-x1031.google.com [IPv6:2607:f8b0:4864:20::1031]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E2A6EC0617A4; Sun, 10 Jan 2021 04:15:43 -0800 (PST) Received: by mail-pj1-x1031.google.com with SMTP id b5so8770063pjl.0; Sun, 10 Jan 2021 04:15:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=5LcHk/djoLn7Im0a8MC7BPIVlKvUBpW71T7HTSyZtvM=; b=O5lBJIX0RFEgUKCa4t1sN8losvZrAe0svC+/OhDjliPS8GDWh0SK+NxKA1nHNgw7GV MkaDqSjl7Nrq3/VXDkvMpj+UR4SPzM/HVpi4frbEsORChfqqe7CcNv08IqCFM2Lqa08b Wy/rXmnKrUCHzLFuiMhxQOmTmtQ02wcH0SJ6jY2ODICPUO5VMHs35TFLrAGFinhO52Yz hqjnmx1IxQZTzYBmP5qKXEUTqQsnPTzCQrgqrvMRuev0i0d4SONiD2SZOvI+QKRa4WK/ quIMQxZc7Wyw1aW23CSbjN7SZHSKkMPuNzgpykUV6uDwW3c0l4K8umhppJzO9xJP2u8l 0dFQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=5LcHk/djoLn7Im0a8MC7BPIVlKvUBpW71T7HTSyZtvM=; b=ObuQNDUYGHh4tLJ/lSNU5WzeFbkMtfhdjuWfkzMXkGSzOM6FzV7S1KQDr8i6w4sdwd hhj1HnFvjjyHW3/IegCZvDejZBFnBpi3hOFFSTwR4N0Ny4efStH7gWduUeoR8ngy3Plp XT5qoH19neZZeZk16pIRc4c7KBl7NIbtItLYWruIhLrIAJxR3whBISxVV7zmmdqFRhxN 64x/YXdvep+ZL0xynCR3oLvWxqh6cdRSy1ByfTOKGourZAw3a3lfrqbkLGETRVty2cU1 LgE56n3yAKzWhGqu7tWeKkBwAv7SkEP2P2wPeACdQSkvK9IWae2pWVHm9NNgDWXVa2gH NMpg== X-Gm-Message-State: AOAM530tu2yNym//wmjDP991I/XdkBz3MNzuKAi8V7tT9OZgNNkAxQOb GL/BOeijFuHEYvzc2BjznAczHaHl1nRHkQ== X-Google-Smtp-Source: ABdhPJwVYC4QdGdeR1/vy2XXXA0K3dfT+pmaaaNTppDHriuZEvmh0dN/3EyUcnvG7B6qLZwxtQwAlg== X-Received: by 2002:a17:90a:c20b:: with SMTP id e11mr12570465pjt.43.1610280943229; Sun, 10 Jan 2021 04:15:43 -0800 (PST) Received: from localhost.localdomain ([2405:201:600d:a089:381d:ba42:3c3c:81ce]) by smtp.googlemail.com with ESMTPSA id y5sm10959791pjt.42.2021.01.10.04.15.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 10 Jan 2021 04:15:42 -0800 (PST) From: Aditya Srivastava To: linux-wireless@vger.kernel.org Cc: pkshih@realtek.com, kvalo@codeaurora.org, davem@davemloft.net, kuba@kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kernel-mentees@lists.linuxfoundation.org, lukas.bulwahn@gmail.com, yashsri421@gmail.com Subject: [PATCH 2/5] rtlwifi: rtl8192c-common: fix bool comparison in expressions Date: Sun, 10 Jan 2021 17:45:22 +0530 Message-Id: <20210110121525.2407-3-yashsri421@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210110121525.2407-1-yashsri421@gmail.com> References: <3c121981-1468-fc9d-7813-483246066cc4@lwfinger.net> <20210110121525.2407-1-yashsri421@gmail.com> Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org There are certain conditional expressions in rtl8192c-common, where a boolean variable is compared with true/false, in forms such as (foo == true) or (false != bar), which does not comply with checkpatch.pl (CHECK: BOOL_COMPARISON), according to which boolean variables should be themselves used in the condition, rather than comparing with true/false E.g., in drivers/net/wireless/realtek/rtlwifi/rtl8192c/dm_common.c, "else if (initialized == false) {" can be replaced with "else if (!initialized) {" Replace all such expressions with the bool variables appropriately Signed-off-by: Aditya Srivastava --- drivers/net/wireless/realtek/rtlwifi/rtl8192c/dm_common.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192c/dm_common.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192c/dm_common.c index 265a1a336304..0b6a15c2e5cc 100644 --- a/drivers/net/wireless/realtek/rtlwifi/rtl8192c/dm_common.c +++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192c/dm_common.c @@ -380,7 +380,7 @@ static void rtl92c_dm_initial_gain_multi_sta(struct ieee80211_hw *hw) initialized = false; dm_digtable->dig_ext_port_stage = DIG_EXT_PORT_STAGE_MAX; return; - } else if (initialized == false) { + } else if (!initialized) { initialized = true; dm_digtable->dig_ext_port_stage = DIG_EXT_PORT_STAGE_0; dm_digtable->cur_igvalue = 0x20; @@ -509,7 +509,7 @@ static void rtl92c_dm_dig(struct ieee80211_hw *hw) { struct rtl_priv *rtlpriv = rtl_priv(hw); - if (rtlpriv->dm.dm_initialgain_enable == false) + if (!rtlpriv->dm.dm_initialgain_enable) return; if (!(rtlpriv->dm.dm_flag & DYNAMIC_FUNC_DIG)) return; From patchwork Sun Jan 10 12:15:23 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aditya Srivastava X-Patchwork-Id: 360891 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=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,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 97B56C43381 for ; Sun, 10 Jan 2021 12:17:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6EAB5224F9 for ; Sun, 10 Jan 2021 12:17:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726709AbhAJMQo (ORCPT ); Sun, 10 Jan 2021 07:16:44 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41108 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726250AbhAJMQn (ORCPT ); Sun, 10 Jan 2021 07:16:43 -0500 Received: from mail-pj1-x102c.google.com (mail-pj1-x102c.google.com [IPv6:2607:f8b0:4864:20::102c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DAB6FC0617A5; Sun, 10 Jan 2021 04:15:47 -0800 (PST) Received: by mail-pj1-x102c.google.com with SMTP id p12so6106037pju.5; Sun, 10 Jan 2021 04:15:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=pDEEvJ1raRHovODvVibZtDrKwCKJS8ji5cQnuEVu9AU=; b=MBjX5Y9FARb2FMBMlNC5DaPzVJYt9sa0Habl/+AgRVKXnklO3mQ3Kd95BGdG0h4APM Y+YhKW270hNPN+GAlVuc4n7KgSHwgA5WKEjy1BcdubFnuwKO8+dFnzebnz0KwgUB3Rd7 EeYcBgAIxt8GKk5zamNAft+QCWbaN83hW0eE/igQZUxbq6tQFRONrDFEhCKJJewbmbWj XHdRg1Fo4UDU9iSoqqfJWkyTgNdgL+lovu2OlyB18snHusjCtYJ3EP7sFoindhpY5Dsv oF1aH8pNj5jyHsnjgV7qj3Gpfa2gmE2lMkQbVgzoCKUPYWb9GuNGamnmhXq7ElclRLK8 4SWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=pDEEvJ1raRHovODvVibZtDrKwCKJS8ji5cQnuEVu9AU=; b=jNgFCXVojVSY73yoBMfal0GXp05Lw1ETx5leC4hFdlCbu3ckb+/7wzIQ2K2qrHNwaY Xa9NyRq8mQtNbYurc4ZfJGMuYD2qx6DOVl+VJAZzNhTiDFIT8tovKQoAOWeccr8gWTbN xcBU46UIS5PquAwFhTbk/I6ISg163Sm70eA/iBt2+pE9NJupdL9swv4cidCRa2HDrKji 0MX9JLE3PoMTPWLxyEQ0NO4AUvDYoqop7JcBcghx0Bp+t6RHtpXGVKbk9s9m6asJ4cNQ WPK+FpsWYjx/XRkI438dnjQax6ddn3fcPW6ZJD0NbQr6Whng9AfNsfHVeLZUr83MwcXp fujw== X-Gm-Message-State: AOAM533AWwVBWlxONHh/j1OjvrHh4FVrRclxrhMReOFdZSfQ0VFGJVZ6 66XIVEH6+sqP0UW2V45BfvzXds960M1whA== X-Google-Smtp-Source: ABdhPJwmOW2gS/r2V+OiuIjnYnknqXowh5GM0aAdpna5+cM/rvaentF8D04RcnV2A9dHu71MAGaQ9Q== X-Received: by 2002:a17:90b:1945:: with SMTP id nk5mr12666347pjb.30.1610280947142; Sun, 10 Jan 2021 04:15:47 -0800 (PST) Received: from localhost.localdomain ([2405:201:600d:a089:381d:ba42:3c3c:81ce]) by smtp.googlemail.com with ESMTPSA id y5sm10959791pjt.42.2021.01.10.04.15.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 10 Jan 2021 04:15:46 -0800 (PST) From: Aditya Srivastava To: linux-wireless@vger.kernel.org Cc: pkshih@realtek.com, kvalo@codeaurora.org, davem@davemloft.net, kuba@kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kernel-mentees@lists.linuxfoundation.org, lukas.bulwahn@gmail.com, yashsri421@gmail.com Subject: [PATCH 3/5] rtlwifi: rtl8188ee: fix bool comparison in expressions Date: Sun, 10 Jan 2021 17:45:23 +0530 Message-Id: <20210110121525.2407-4-yashsri421@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210110121525.2407-1-yashsri421@gmail.com> References: <3c121981-1468-fc9d-7813-483246066cc4@lwfinger.net> <20210110121525.2407-1-yashsri421@gmail.com> Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org There are certain conditional expressions in rtl8188ee, where a boolean variable is compared with true/false, in forms such as (foo == true) or (false != bar), which does not comply with checkpatch.pl (CHECK: BOOL_COMPARISON), according to which boolean variables should be themselves used in the condition, rather than comparing with true/false E.g., in drivers/net/wireless/realtek/rtlwifi/rtl8188ee/dm.c, "if (mac->act_scanning == true)" can be replaced with "if (mac->act_scanning)" Replace all such expressions with the bool variables appropriately Signed-off-by: Aditya Srivastava --- drivers/net/wireless/realtek/rtlwifi/rtl8188ee/dm.c | 8 ++++---- drivers/net/wireless/realtek/rtlwifi/rtl8188ee/hw.c | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/dm.c b/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/dm.c index d10c14c694da..6f61d6a10627 100644 --- a/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/dm.c +++ b/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/dm.c @@ -474,11 +474,11 @@ static void rtl88e_dm_dig(struct ieee80211_hw *hw) u8 dm_dig_max, dm_dig_min; u8 current_igi = dm_dig->cur_igvalue; - if (rtlpriv->dm.dm_initialgain_enable == false) + if (!rtlpriv->dm.dm_initialgain_enable) return; - if (dm_dig->dig_enable_flag == false) + if (!dm_dig->dig_enable_flag) return; - if (mac->act_scanning == true) + if (mac->act_scanning) return; if (mac->link_state >= MAC80211_LINKED) @@ -1637,7 +1637,7 @@ static void rtl88e_dm_fast_ant_training(struct ieee80211_hw *hw) } } - if (bpkt_filter_match == false) { + if (!bpkt_filter_match) { rtl_set_bbreg(hw, DM_REG_TXAGC_A_1_MCS32_11N, BIT(16), 0); rtl_set_bbreg(hw, DM_REG_IGI_A_11N, BIT(7), 0); diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/hw.c b/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/hw.c index bd9160b166c5..861cc663ca93 100644 --- a/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/hw.c +++ b/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/hw.c @@ -1269,12 +1269,12 @@ void rtl88ee_set_check_bssid(struct ieee80211_hw *hw, bool check_bssid) if (rtlpriv->psc.rfpwr_state != ERFON) return; - if (check_bssid == true) { + if (check_bssid) { reg_rcr |= (RCR_CBSSID_DATA | RCR_CBSSID_BCN); rtlpriv->cfg->ops->set_hw_reg(hw, HW_VAR_RCR, (u8 *)(®_rcr)); _rtl88ee_set_bcn_ctrl_reg(hw, 0, BIT(4)); - } else if (check_bssid == false) { + } else if (!check_bssid) { reg_rcr &= (~(RCR_CBSSID_DATA | RCR_CBSSID_BCN)); _rtl88ee_set_bcn_ctrl_reg(hw, BIT(4), 0); rtlpriv->cfg->ops->set_hw_reg(hw, From patchwork Sun Jan 10 12:15:24 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aditya Srivastava X-Patchwork-Id: 360362 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=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,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 653A9C433DB for ; Sun, 10 Jan 2021 12:17:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 22C3C224DE for ; Sun, 10 Jan 2021 12:17:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726737AbhAJMQo (ORCPT ); Sun, 10 Jan 2021 07:16:44 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41110 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726666AbhAJMQn (ORCPT ); Sun, 10 Jan 2021 07:16:43 -0500 Received: from mail-pg1-x531.google.com (mail-pg1-x531.google.com [IPv6:2607:f8b0:4864:20::531]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A5CA6C0617A6; Sun, 10 Jan 2021 04:15:52 -0800 (PST) Received: by mail-pg1-x531.google.com with SMTP id n7so10784863pgg.2; Sun, 10 Jan 2021 04:15:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=YTc1II9ACj1oYqqot33qA4ayP2h78MhFEqKnLEwd3cg=; b=lXlNqKSB1WT/06xJmknbydbtn2KROIF2e+XrhojUPkwwXA95s5qNeAjiMvf6EFlNtU doaXT8YzHMJ8VPtoN/VE2eTLvx3nqNfou5cnpvekM/BQlr9Ys6cLi6J5Jokqq3NL9lsd uXhygadpsGlzxXbsOg23Rz8ygs5t9F+I9TBOaOxkRzV36M2qukJqtCYr3nF6sQg9x9Qn ACVBKxuCoeEOdDkLF7yp4JRSNsr2w+Pc0M3ta2VehMbIcnu2b5duS7on/ReNn+qFmzuC UtWX0Klp42c3t45FsFHCTI1yJtJusT5m3M57SIrPizFM2DzadEdnrNKFhPNWU3dBe5p9 OIzg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=YTc1II9ACj1oYqqot33qA4ayP2h78MhFEqKnLEwd3cg=; b=W+zZGb2whO9gmcvH97aPWk4BYPeohdoslfW98n5dWum1DtZ9DAJoemjYk87MIgFpY9 cN7L1f/uP4DyEsEZZvimgzgzR3Wg4L/WnIpUtBs75rrXosDlqNo8KS4iExFegLkYPOfm uwoZMC64cDiVzTC0kRkQx7MLNm+opgcLBqfXexgOsrsie/QEqJ/yib6RpaaO3DDLBAmb newcr2WF+JPK2nIChVmVYl6XjDRxni54BtK8jbBFRjeyr82jyzbORm7YeunlkqYVqahl zLJxtQErUBpV86LF9DzsyJYiwUFsXkzjUky38C58L7vuLgyez7H6VWFk3Sjy9goQ99vY GK4w== X-Gm-Message-State: AOAM5328yMj0ckvUcqnuizfWgsvzLxOUx6Q3aZSSYqwoibV6lTJacSXZ OdX6rsh4YfgS2t1zCOT74T1E3HJrjfTbsQ== X-Google-Smtp-Source: ABdhPJyweUMzxtoGdLkP4eQrEr3IkevhAfKwZ7liWN3FD2t4BNbzorjUd4KIR2CEX4FkHGgx4/b3dw== X-Received: by 2002:aa7:970f:0:b029:19e:758b:dab1 with SMTP id a15-20020aa7970f0000b029019e758bdab1mr15239229pfg.24.1610280951963; Sun, 10 Jan 2021 04:15:51 -0800 (PST) Received: from localhost.localdomain ([2405:201:600d:a089:381d:ba42:3c3c:81ce]) by smtp.googlemail.com with ESMTPSA id y5sm10959791pjt.42.2021.01.10.04.15.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 10 Jan 2021 04:15:51 -0800 (PST) From: Aditya Srivastava To: linux-wireless@vger.kernel.org Cc: pkshih@realtek.com, kvalo@codeaurora.org, davem@davemloft.net, kuba@kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kernel-mentees@lists.linuxfoundation.org, lukas.bulwahn@gmail.com, yashsri421@gmail.com Subject: [PATCH 4/5] rtlwifi: rtl8192se: fix bool comparison in expressions Date: Sun, 10 Jan 2021 17:45:24 +0530 Message-Id: <20210110121525.2407-5-yashsri421@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210110121525.2407-1-yashsri421@gmail.com> References: <3c121981-1468-fc9d-7813-483246066cc4@lwfinger.net> <20210110121525.2407-1-yashsri421@gmail.com> Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org There are certain conditional expressions in rtl8192se, where a boolean variable is compared with true/false, in forms such as (foo == true) or (false != bar), which does not comply with checkpatch.pl (CHECK: BOOL_COMPARISON), according to which boolean variables should be themselves used in the condition, rather than comparing with true/false Replace all such expressions with the bool variables appropriately Signed-off-by: Aditya Srivastava --- drivers/net/wireless/realtek/rtlwifi/rtl8192se/hw.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192se/hw.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192se/hw.c index 47fabce5c235..73a5d8a068fc 100644 --- a/drivers/net/wireless/realtek/rtlwifi/rtl8192se/hw.c +++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192se/hw.c @@ -458,7 +458,7 @@ static u8 _rtl92se_halset_sysclk(struct ieee80211_hw *hw, u8 data) tmpvalue = rtl_read_byte(rtlpriv, SYS_CLKR + 1); bresult = ((tmpvalue & BIT(7)) == (data & BIT(7))); - if ((data & (BIT(6) | BIT(7))) == false) { + if (!(data & (BIT(6) | BIT(7)))) { waitcount = 100; tmpvalue = 0; @@ -1268,7 +1268,7 @@ static u8 _rtl92s_set_sysclk(struct ieee80211_hw *hw, u8 data) tmp = rtl_read_byte(rtlpriv, SYS_CLKR + 1); result = ((tmp & BIT(7)) == (data & BIT(7))); - if ((data & (BIT(6) | BIT(7))) == false) { + if (!(data & (BIT(6) | BIT(7)))) { waitcnt = 100; tmp = 0; From patchwork Sun Jan 10 12:15:25 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aditya Srivastava X-Patchwork-Id: 360890 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=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,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 03555C43331 for ; Sun, 10 Jan 2021 12:17:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C8904206E9 for ; Sun, 10 Jan 2021 12:17:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726807AbhAJMQ4 (ORCPT ); Sun, 10 Jan 2021 07:16:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41156 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726387AbhAJMQy (ORCPT ); Sun, 10 Jan 2021 07:16:54 -0500 Received: from mail-pj1-x1034.google.com (mail-pj1-x1034.google.com [IPv6:2607:f8b0:4864:20::1034]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9DE82C0617A7; Sun, 10 Jan 2021 04:15:56 -0800 (PST) Received: by mail-pj1-x1034.google.com with SMTP id iq13so6110723pjb.3; Sun, 10 Jan 2021 04:15:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=T7ThywqXuhxC8F6Hh3LDj1yvDqMYokNpJlLIGbeNsvg=; b=RJNN5BgGe8mKnEWypJ7UYPnfrK6Jxoaz8eUBmO+P/O89GAkqfT1ln2VZIiVO2f8AXR bhqozprqbGV9Mg/ZisW9ECc8jP/mk+nqS89Qnr/DRD88jkss5HEz2HfSx7AEn0ycLRq8 4hG3cAX+L5XMyK58ByN8Bq4Jx9965rX7jPr59WKW3hJecoeWEck83icdNU7NEqtcCnnD MiR34KsXkRGX+jrHvt9stgwoqGIcQI+WMBIahCmFsuBT3TLpSzgaXzgn1wkofsKpqLkf tcGZbrtuyd9FCx8XYlBBXTf2Z9vflnJIN5b7Jpzr9zSYvzKCjPd3qWhafuqVw5qOig/y fw0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=T7ThywqXuhxC8F6Hh3LDj1yvDqMYokNpJlLIGbeNsvg=; b=WTF7Mt/4tiZqCukmKSDi8Uq5r03gQc1vQArVJOKD1N+ZUj+M8u/8GaL3nfxtNFUSaq dm5RtHR1vxtDIjQ1d+iQetIEb7aV79G6x0UQGVQRqXu+Rby/SZjc22aWV1LPMH04D3D5 MkjPL38YGaWUDsZIcflkmQUUsmVyZapmrf/mkL0dE1ov34QwzSkj2C1Kz9b3E/c/bngi 3OZCL1pEd0aTALsJebGGOouBEmCSpSE8LuVepEKO82UPVjPldOc/RdOetfjj84QynrZL ZM1J4Uk0v6e8YZliBDasUgPx26JBYGvMdVFNvvviB6DHImDPxL1tR+9Z2QS/uZApZGEw lQaw== X-Gm-Message-State: AOAM5335079NuY5memGFaSxfpvekn/na9u0cR6/ATUfB/bZclXiynj2O dDrvqrnTHyOmhLwR/X2ZUtWU1yTjHXqGtA== X-Google-Smtp-Source: ABdhPJys2QAtK2nStXpmMUaaqsBFY49SSm7RfqzrRy2zOk36qHLcn1ATn8LKYR/FYtmW8MIDE65AIQ== X-Received: by 2002:a17:90a:5303:: with SMTP id x3mr13072178pjh.54.1610280955942; Sun, 10 Jan 2021 04:15:55 -0800 (PST) Received: from localhost.localdomain ([2405:201:600d:a089:381d:ba42:3c3c:81ce]) by smtp.googlemail.com with ESMTPSA id y5sm10959791pjt.42.2021.01.10.04.15.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 10 Jan 2021 04:15:55 -0800 (PST) From: Aditya Srivastava To: linux-wireless@vger.kernel.org Cc: pkshih@realtek.com, kvalo@codeaurora.org, davem@davemloft.net, kuba@kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kernel-mentees@lists.linuxfoundation.org, lukas.bulwahn@gmail.com, yashsri421@gmail.com Subject: [PATCH 5/5] rtlwifi: rtl8821ae: fix bool comparison in expressions Date: Sun, 10 Jan 2021 17:45:25 +0530 Message-Id: <20210110121525.2407-6-yashsri421@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210110121525.2407-1-yashsri421@gmail.com> References: <3c121981-1468-fc9d-7813-483246066cc4@lwfinger.net> <20210110121525.2407-1-yashsri421@gmail.com> Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org There are certain conditional expressions in rtl8821ae, where a boolean variable is compared with true/false, in forms such as (foo == true) or (false != bar), which does not comply with checkpatch.pl (CHECK: BOOL_COMPARISON), according to which boolean variables should be themselves used in the condition, rather than comparing with true/false E.g., in drivers/net/wireless/realtek/rtlwifi/rtl8821ae/phy.c, "if (rtlefuse->autoload_failflag == false)" can be replaced with "if (!rtlefuse->autoload_failflag)" Replace all such expressions with the bool variables appropriately Signed-off-by: Aditya Srivastava --- drivers/net/wireless/realtek/rtlwifi/rtl8821ae/phy.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/phy.c b/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/phy.c index 372d6f8caf06..e214b9062cc1 100644 --- a/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/phy.c +++ b/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/phy.c @@ -1812,7 +1812,7 @@ static bool _rtl8821ae_phy_bb8821a_config_parafile(struct ieee80211_hw *hw) return false; } _rtl8821ae_phy_init_tx_power_by_rate(hw); - if (rtlefuse->autoload_failflag == false) { + if (!rtlefuse->autoload_failflag) { rtstatus = _rtl8821ae_phy_config_bb_with_pgheaderfile(hw, BASEBAND_CONFIG_PHY_REG); } @@ -3980,7 +3980,7 @@ static void _rtl8821ae_iqk_tx(struct ieee80211_hw *hw, enum radio_path path) } } - if (tx0iqkok == false) + if (!tx0iqkok) break; /* TXK fail, Don't do RXK */ if (vdf_enable == 1) { @@ -4090,7 +4090,7 @@ static void _rtl8821ae_iqk_tx(struct ieee80211_hw *hw, enum radio_path path) } } - if (tx0iqkok == false) { /* If RX mode TXK fail, then take TXK Result */ + if (!tx0iqkok) { /* If RX mode TXK fail, then take TXK Result */ tx_x0_rxk[cal] = tx_x0[cal]; tx_y0_rxk[cal] = tx_y0[cal]; tx0iqkok = true; @@ -4249,7 +4249,7 @@ static void _rtl8821ae_iqk_tx(struct ieee80211_hw *hw, enum radio_path path) } } - if (tx0iqkok == false) { /* If RX mode TXK fail, then take TXK Result */ + if (!tx0iqkok) { /* If RX mode TXK fail, then take TXK Result */ tx_x0_rxk[cal] = tx_x0[cal]; tx_y0_rxk[cal] = tx_y0[cal]; tx0iqkok = true;