Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp742766pxb; Tue, 19 Oct 2021 12:01:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxAyhM6HQZ3xHOs8zxjTKOmpJggnd8TU+1ZLls4skeRLouh0AsND6ErniIIY7gjWEtE1Q0g X-Received: by 2002:a50:9d8e:: with SMTP id w14mr55254346ede.74.1634670083883; Tue, 19 Oct 2021 12:01:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634670083; cv=none; d=google.com; s=arc-20160816; b=NVA1qDioIDVb9vA26A1Mx0OXdhDtJuFhipcSS14v8Mepr94znwnV3K7PWgZuvwkKkV 8RDPioHbSaGwWlkBX1Mo5wmcIQqS36h0243y/zhfHDVKyPczn8+KknenzKYI7rY9qrHF kKiypmPVqggnRbbLCBphoR06/0XIDbAmJjdeTqiQ2whj/hvyLMtAhcZBZmfE7hhWspte Ag/l6VpuMLa6WBBoHdu1jIjQKoQHD+afYnwOgcc6X7aX4qpiRQY1/gLIHbhGtJCkZlQX lOvE9/RQz22gXR+bq0ztbaaKqDreVCOWxTNj1G7ObmGVCgbLRQ8fjAWF97fIRpR4jw5U GFww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:references:message-id :in-reply-to:subject:cc:to:from:date:ironport-hdrordr; bh=t/O1C5wJhKKPRSKZuugeUtmfyTBthZ9Jl9SeZ1LsZxY=; b=tWsjgp+SDSYJh06BAdaJnqxUuH3IqXudadE6k/RrkaYXqskptRvYZhoAkiJZ5gs9gs E1PDUAIh5Pg3tFUtAbYYaTUCLg1fUfW9gBZj7SuCfC/hGBx209bdCURjzdOg/w6cTMWD xY0+naUTLIzo9nnK4XMdJTICo3Xn1ONjjFykYq7jZL2HY0QApaTlW2tjZ4Z/jb3hKkL8 hu1KUedYzU3UxFMeE84trKnWexA/ZF1YVMmL3O4QfAA3Ulzmu8cj2umiTsoXPIvco38v GwphvSIkFsOiJqVWIXRw+ax69wBTPKg5Yl3ggc0vxx7UlEv/geQ8NgQGqACOc+0UskoZ EMIg== 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 k3si1335492ejk.365.2021.10.19.12.00.56; Tue, 19 Oct 2021 12:01:23 -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 S234361AbhJSTAO (ORCPT + 99 others); Tue, 19 Oct 2021 15:00:14 -0400 Received: from mail3-relais-sop.national.inria.fr ([192.134.164.104]:20857 "EHLO mail3-relais-sop.national.inria.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231355AbhJSTAO (ORCPT ); Tue, 19 Oct 2021 15:00:14 -0400 IronPort-HdrOrdr: =?us-ascii?q?A9a23=3AvLn2Aa395PT2t2q323qPGQqjBK0kLtp133Aq?= =?us-ascii?q?2lEZdPUnSKOlfqeV7ZYmPH7P+VUssR4b8+xoVJPgfZq+z/NICOsqVotKNTOO0F?= =?us-ascii?q?dAR7sD0WKN+VPd8mHFmtJg6Q=3D=3D?= X-IronPort-AV: E=Sophos;i="5.84,326,1620684000"; d="scan'208";a="396421478" Received: from 173.121.68.85.rev.sfr.net (HELO hadrien) ([85.68.121.173]) by mail3-relais-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 19 Oct 2021 20:57:59 +0200 Date: Tue, 19 Oct 2021 20:57:59 +0200 (CEST) From: Julia Lawall X-X-Sender: jll@hadrien To: Kushal Kothari cc: gregkh@linuxfoundation.org, fabioaiuto83@gmail.com, marcocesati@gmail.com, dan.carpenter@oracle.com, ross.schm.dev@gmail.com, linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org, outreachy-kernel@googlegroups.com, mike.rapoport@gmail.com Subject: Re: [Outreachy kernel] [PATCH] staging: rtl8723bs: core: Remove true and false comparison In-Reply-To: <20211019172359.63583-1-kushalkothari285@gmail.com> Message-ID: References: <20211019172359.63583-1-kushalkothari285@gmail.com> User-Agent: Alpine 2.22 (DEB 394 2020-01-19) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 19 Oct 2021, Kushal Kothari wrote: > Remove comparison to true and false in if statement. > Issue found with checkpatch.pl. > CHECK: Using comparison to true is error prone > CHECK: Using comparison to false is error prone > > Signed-off-by: Kushal Kothari > --- > drivers/staging/rtl8723bs/core/rtw_cmd.c | 16 ++++++++-------- > 1 file changed, 8 insertions(+), 8 deletions(-) > > diff --git a/drivers/staging/rtl8723bs/core/rtw_cmd.c b/drivers/staging/rtl8723bs/core/rtw_cmd.c > index efc9b1974e38..b473f1d1ce08 100644 > --- a/drivers/staging/rtl8723bs/core/rtw_cmd.c > +++ b/drivers/staging/rtl8723bs/core/rtw_cmd.c > @@ -309,8 +309,8 @@ int rtw_cmd_filter(struct cmd_priv *pcmdpriv, struct cmd_obj *cmd_obj) > if (cmd_obj->cmdcode == GEN_CMD_CODE(_SetChannelPlan)) > bAllow = true; > > - if ((pcmdpriv->padapter->hw_init_completed == false && bAllow == false) > - || atomic_read(&(pcmdpriv->cmdthd_running)) == false /* com_thread not running */ > + if ((!pcmdpriv->padapter->hw_init_completed && !bAllow) > + || !atomic_read(&(pcmdpriv->cmdthd_running)) /* com_thread not running */ > ) > return _FAIL; > > @@ -407,7 +407,7 @@ int rtw_cmd_thread(void *context) > break; > } > > - if ((padapter->bDriverStopped == true) || (padapter->bSurpriseRemoved == true)) { > + if ((padapter->bDriverStopped) || (padapter->bSurpriseRemoved)) { The parentheses are pretty useless once you have removed the comparison. julia > netdev_dbg(padapter->pnetdev, > "%s: DriverStopped(%d) SurpriseRemoved(%d) break at line %d\n", > __func__, padapter->bDriverStopped, > @@ -430,7 +430,7 @@ int rtw_cmd_thread(void *context) > continue; > > _next: > - if ((padapter->bDriverStopped == true) || (padapter->bSurpriseRemoved == true)) { > + if ((padapter->bDriverStopped) || (padapter->bSurpriseRemoved)) { > netdev_dbg(padapter->pnetdev, > "%s: DriverStopped(%d) SurpriseRemoved(%d) break at line %d\n", > __func__, padapter->bDriverStopped, > @@ -927,7 +927,7 @@ u8 rtw_setstakey_cmd(struct adapter *padapter, struct sta_info *sta, u8 unicast_ > else > GET_ENCRY_ALGO(psecuritypriv, sta, psetstakey_para->algorithm, false); > > - if (unicast_key == true) > + if (unicast_key) > memcpy(&psetstakey_para->key, &sta->dot118021x_UncstKey, 16); > else > memcpy(&psetstakey_para->key, &psecuritypriv->dot118021XGrpKey[psecuritypriv->dot118021XGrpKeyid].skey, 16); > @@ -1283,7 +1283,7 @@ u8 traffic_status_watchdog(struct adapter *padapter, u8 from_timer) > (pmlmepriv->LinkDetectInfo.NumRxUnicastOkInPeriod > 2)) { > bEnterPS = false; > > - if (bBusyTraffic == true) { > + if (bBusyTraffic) { > if (pmlmepriv->LinkDetectInfo.TrafficTransitionCount <= 4) > pmlmepriv->LinkDetectInfo.TrafficTransitionCount = 4; > > @@ -1619,7 +1619,7 @@ static void rtw_chk_hi_queue_hdl(struct adapter *padapter) > > rtw_hal_get_hwreg(padapter, HW_VAR_CHK_HI_QUEUE_EMPTY, &empty); > > - while (false == empty && jiffies_to_msecs(jiffies - start) < g_wait_hiq_empty) { > + while (!empty && jiffies_to_msecs(jiffies - start) < g_wait_hiq_empty) { > msleep(100); > rtw_hal_get_hwreg(padapter, HW_VAR_CHK_HI_QUEUE_EMPTY, &empty); > } > @@ -2054,7 +2054,7 @@ void rtw_setassocsta_cmdrsp_callback(struct adapter *padapter, struct cmd_obj * > > spin_lock_bh(&pmlmepriv->lock); > > - if ((check_fwstate(pmlmepriv, WIFI_MP_STATE) == true) && (check_fwstate(pmlmepriv, _FW_UNDER_LINKING) == true)) > + if ((check_fwstate(pmlmepriv, WIFI_MP_STATE)) && (check_fwstate(pmlmepriv, _FW_UNDER_LINKING))) > _clr_fwstate_(pmlmepriv, _FW_UNDER_LINKING); > > set_fwstate(pmlmepriv, _FW_LINKED); > -- > 2.25.1 > > -- > You received this message because you are subscribed to the Google Groups "outreachy-kernel" group. > To unsubscribe from this group and stop receiving emails from it, send an email to outreachy-kernel+unsubscribe@googlegroups.com. > To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20211019172359.63583-1-kushalkothari285%40gmail.com. >