From: Praveen Kumar <kpraveen.lkml@gmail.com>
To: Kushal Kothari <kushalkothari285@gmail.com>, gregkh@linuxfoundation.org
Cc: fabioaiuto83@gmail.com, ross.schm.dev@gmail.com,
fmdefrancesco@gmail.com, marcocesati@gmail.com,
straube.linux@gmail.com, philippesdixon@gmail.com,
manuelpalenzuelamerino@gmail.com, linux-staging@lists.linux.dev,
linux-kernel@vger.kernel.org, mike.rapoport@gmail.com,
kushalkotharitest@googlegroups.com,
outreachy-kernel@googlegroups.com
Subject: Re: [Outreachy kernel] [PATCH 1/4] staging: rtl8723bs: core: Remove true and false comparison
Date: Fri, 22 Oct 2021 08:14:29 +0530 [thread overview]
Message-ID: <32059290-6c59-1cee-5edc-563fe5c2f18b@gmail.com> (raw)
In-Reply-To: <a9b75b3ab7c83dc5cef541301263fe17a704f026.1634845504.git.kushalkothari285@gmail.com>
On 22-10-2021 01:27, 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 <kushalkothari285@gmail.com>
> ---
> drivers/staging/rtl8723bs/core/rtw_cmd.c | 22 +++++++++++-----------
> 1 file changed, 11 insertions(+), 11 deletions(-)
>
> diff --git a/drivers/staging/rtl8723bs/core/rtw_cmd.c b/drivers/staging/rtl8723bs/core/rtw_cmd.c
> index 2624e994513f..0be3a8dbeec8 100644
> --- a/drivers/staging/rtl8723bs/core/rtw_cmd.c
> +++ b/drivers/staging/rtl8723bs/core/rtw_cmd.c
> @@ -371,7 +371,7 @@ void rtw_free_cmd_obj(struct cmd_obj *pcmd)
> void rtw_stop_cmd_thread(struct adapter *adapter)
> {
> if (adapter->cmdThread &&
> - atomic_read(&(adapter->cmdpriv.cmdthd_running)) == true &&
> + atomic_read(&adapter->cmdpriv.cmdthd_running) &&
Lets keep it "atomic_read(&(adapter->cmdpriv.cmdthd_running))"
and remove the parentheses in next patch.
> adapter->cmdpriv.stop_req == 0) {
> adapter->cmdpriv.stop_req = 1;
> complete(&adapter->cmdpriv.cmd_queue_comp);
> @@ -542,7 +542,7 @@ u8 rtw_sitesurvey_cmd(struct adapter *padapter, struct ndis_802_11_ssid *ssid,
> struct cmd_priv *pcmdpriv = &padapter->cmdpriv;
> struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
>
> - if (check_fwstate(pmlmepriv, _FW_LINKED) == true)
> + if (check_fwstate(pmlmepriv, _FW_LINKED))
> rtw_lps_ctrl_wk_cmd(padapter, LPS_CTRL_SCAN, 1);
>
> ph2c = rtw_zmalloc(sizeof(struct cmd_obj));
> @@ -775,7 +775,7 @@ u8 rtw_joinbss_cmd(struct adapter *padapter, struct wlan_network *pnetwork)
> /* If not, we have to copy the connecting AP's MAC address to it so that */
> /* the driver just has the bssid information for PMKIDList searching. */
>
> - if (pmlmepriv->assoc_by_bssid == false)
> + if (!pmlmepriv->assoc_by_bssid)
> memcpy(&pmlmepriv->assoc_bssid[0], &pnetwork->network.mac_address[0], ETH_ALEN);
>
> psecnetwork->ie_length = rtw_restruct_sec_ie(padapter, &pnetwork->network.ies[0], &psecnetwork->ies[0], pnetwork->network.ie_length);
> @@ -1164,7 +1164,7 @@ u8 rtw_set_chplan_cmd(struct adapter *padapter, u8 chplan, u8 enqueue, u8 swconf
> u8 res = _SUCCESS;
>
> /* check if allow software config */
> - if (swconfig && rtw_hal_is_disable_sw_channel_plan(padapter) == true) {
> + if (swconfig && rtw_hal_is_disable_sw_channel_plan(padapter)) {
> res = _FAIL;
> goto exit;
> }
> @@ -1250,7 +1250,7 @@ u8 traffic_status_watchdog(struct adapter *padapter, u8 from_timer)
> /* */
> /* Determine if our traffic is busy now */
> /* */
> - if ((check_fwstate(pmlmepriv, _FW_LINKED) == true)
> + if ((check_fwstate(pmlmepriv, _FW_LINKED))
> /*&& !MgntInitAdapterInProgress(pMgntInfo)*/) {
> /* if we raise bBusyTraffic in last watchdog, using lower threshold. */
> if (pmlmepriv->LinkDetectInfo.bBusyTraffic)
> @@ -1342,7 +1342,7 @@ static void dynamic_chk_wk_hdl(struct adapter *padapter)
>
> pmlmepriv = &(padapter->mlmepriv);
>
> - if (check_fwstate(pmlmepriv, WIFI_AP_STATE) == true)
> + if (check_fwstate(pmlmepriv, WIFI_AP_STATE))
> expire_timeout_chk(padapter);
>
> /* for debug purpose */
> @@ -1377,8 +1377,8 @@ void lps_ctrl_wk_hdl(struct adapter *padapter, u8 lps_ctrl_type)
> struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
> u8 mstatus;
>
> - if ((check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) == true)
> - || (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) == true)) {
> + if (check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) ||
> + check_fwstate(pmlmepriv, WIFI_ADHOC_STATE)) {
> return;
> }
>
> @@ -1386,7 +1386,7 @@ void lps_ctrl_wk_hdl(struct adapter *padapter, u8 lps_ctrl_type)
> case LPS_CTRL_SCAN:
> hal_btcoex_ScanNotify(padapter, true);
>
> - if (check_fwstate(pmlmepriv, _FW_LINKED) == true) {
> + if (check_fwstate(pmlmepriv, _FW_LINKED)) {
> /* connect */
> LPS_Leave(padapter, "LPS_CTRL_SCAN");
> }
> @@ -1512,7 +1512,7 @@ static void rtw_lps_change_dtim_hdl(struct adapter *padapter, u8 dtim)
> if (dtim <= 0 || dtim > 16)
> return;
>
> - if (hal_btcoex_IsBtControlLps(padapter) == true)
> + if (hal_btcoex_IsBtControlLps(padapter))
> return;
>
> mutex_lock(&pwrpriv->lock);
> @@ -1840,7 +1840,7 @@ static void c2h_wk_callback(struct work_struct *work)
> continue;
> }
>
> - if (ccx_id_filter(c2h_evt) == true) {
> + if (ccx_id_filter(c2h_evt)) {
> /* Handle CCX report here */
> rtw_hal_c2h_handler(adapter, c2h_evt);
> kfree(c2h_evt);
>
Regards,
~Praveen.
next prev parent reply other threads:[~2021-10-22 2:44 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-21 19:57 [PATCH 0/4] staging: rtl8723bs: core: Cleanup patchset for style issues in rtw_cmd.c Kushal Kothari
2021-10-21 19:57 ` [PATCH 1/4] staging: rtl8723bs: core: Remove true and false comparison Kushal Kothari
2021-10-22 2:44 ` Praveen Kumar [this message]
2021-11-03 11:52 ` [Outreachy kernel] " Dan Carpenter
2021-10-21 19:57 ` [PATCH 2/4] staging: rtl8723bs: core: Remove unnecessary parentheses Kushal Kothari
2021-10-21 19:57 ` [PATCH 3/4] staging: rtl8723bs: core: Remove unnecessary space after a cast Kushal Kothari
2021-10-22 2:48 ` [Outreachy kernel] " Praveen Kumar
2021-10-21 19:57 ` [PATCH 4/4] staging: rtl8723bs: core: Remove unnecessary blank lines Kushal Kothari
2021-10-22 6:03 ` Greg KH
2021-10-22 2:45 ` [Outreachy kernel] [PATCH 0/4] staging: rtl8723bs: core: Cleanup patchset for style issues in rtw_cmd.c Praveen Kumar
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=32059290-6c59-1cee-5edc-563fe5c2f18b@gmail.com \
--to=kpraveen.lkml@gmail.com \
--cc=fabioaiuto83@gmail.com \
--cc=fmdefrancesco@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=kushalkothari285@gmail.com \
--cc=kushalkotharitest@googlegroups.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
--cc=manuelpalenzuelamerino@gmail.com \
--cc=marcocesati@gmail.com \
--cc=mike.rapoport@gmail.com \
--cc=outreachy-kernel@googlegroups.com \
--cc=philippesdixon@gmail.com \
--cc=ross.schm.dev@gmail.com \
--cc=straube.linux@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome