From nobody Sun May 24 19:35:54 2026 Received: from sender-pp-o91.zoho.in (sender-pp-o91.zoho.in [103.117.158.91]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3369E314B73 for ; Sat, 23 May 2026 10:44:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass smtp.client-ip=103.117.158.91 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779533074; cv=pass; b=szKJMyYLdPiOZDJ7E6m4wNF6kHfXMbmzdknNhC3YYRCyLhOeEFL6/7nA7dPCaaOpiacTU8eQqBehnoviI73BhdY9TmS6EiR4Td7hxS3L1ZsqQSXQxFy3Iyu+qXPM2B/psH1AXdvs3c2vfRQ/OHuxhqw/z+4JXn/xMXsp5Ts0I8w= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779533074; c=relaxed/simple; bh=sVRDp1+5sOqHjrUou6x9bU1mPlbxlV4Cs1rquE71OOE=; h=Date:From:To:Cc:Message-ID:In-Reply-To:Subject:MIME-Version: Content-Type; b=eCN5/JN1SFhFb+OJ2GuNC20hB/R0Cis2ZROQgoZz+3lPyLGXywzPavyEcoAm0j64EZYPOt61C2C4j7dp4pyTTVPSXUcrVHFOm/dgX8QQPFFc8XIgUU9Co98tilkuNQ4WD/9hDUI6wzr2TaEITDJq1UlqYMBqD7fW/vFzGF1QyEE= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=zohomail.in; spf=pass smtp.mailfrom=zohomail.in; dkim=pass (1024-bit key) header.d=zohomail.in header.i=linuxuser509@zohomail.in header.b=GTV80apa; arc=pass smtp.client-ip=103.117.158.91 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=zohomail.in Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=zohomail.in Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=zohomail.in header.i=linuxuser509@zohomail.in header.b="GTV80apa" ARC-Seal: i=1; a=rsa-sha256; t=1779533054; cv=none; d=zohomail.in; s=zohoarc; b=aJXB1UCbF7d4iYIY4aiKc1h1asFQGEbDDVPyCt+wqxyt7X+UMnwJm4HKh4R9A7RHY7lz9Jy70U3X6EudAwHepbzOAk/EG5ad3JnN8k9r9WVpXJswI5LAtPn2sdXtmzgWEFt+e4sDbzUJP4LK06qRaeESH3EdfTLfSVVANOdUJ0w= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.in; s=zohoarc; t=1779533054; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:MIME-Version:Message-ID:Subject:Subject:To:To:Message-Id:Reply-To; bh=QPAfujFQXRT4FXHj+F7zrHmL/zglAT1nT2MR7yAkTS8=; b=AjqmbSrSFOJqBOVtDUOu+2Rb7HDvREtujo2BIZv1ZCLwwSnItTnYrxjoII/PL8fiX/SoImUk+TqJqKsAYSXNFLY9d7a4cwadb8f4JIeI9qyCJcZMVgJL6bIdO1WLJhLQey8a5yRy7Fmv3OGEvrntK5bQVD1S8etGeSefdOSDlAU= ARC-Authentication-Results: i=1; mx.zohomail.in; dkim=pass header.i=zohomail.in; spf=pass smtp.mailfrom=linuxuser509@zohomail.in; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1779533054; s=zoho; d=zohomail.in; i=linuxuser509@zohomail.in; h=Date:Date:From:From:To:To:Cc:Cc:Message-ID:In-Reply-To:Subject:Subject:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-Id:Reply-To; bh=QPAfujFQXRT4FXHj+F7zrHmL/zglAT1nT2MR7yAkTS8=; b=GTV80apamoqLmwnSZQGzWcQsan2wBcwd/+jPss+3X/r4YOwdGbReBPw+8MV4Vg1+ dj62JWsatHaVSFnKGT9O5ngv3Vz3hT4sC99ctdUY3rw078c910j4tRsyYo9oFx8bFDP jdHCr79cnzKZk70h8SVNN208GHyMse8nTm2x0Ezs= Received: from mail.zoho.in by mx.zoho.in with SMTP id 1779533052807530.9651488997646; Sat, 23 May 2026 16:14:12 +0530 (IST) Received: from [157.35.75.45] by mail.zoho.in with HTTP;Sat, 23 May 2026 16:14:12 +0530 (IST) Date: Sat, 23 May 2026 16:14:12 +0530 From: Ashwin Gundarapu To: "gregkh" Cc: "linux-kernel" , "linux-staging" Message-ID: <19e546f7b7d.2192aa4a49317.2370843901367566351@zohomail.in> In-Reply-To: Subject: [PATCH v2] staging: rtl8723bs: remove unnecessary boolean comparisons in rtw_recv.c Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Importance: Medium User-Agent: Zoho Mail X-Mailer: Zoho Mail Content-Type: text/plain; charset="utf-8" Remove explicit comparisons to true and false. Replace '=3D=3D false' with the '!' operator and remove '=3D=3D true' entirely. Found by checkpatch.pl --strict Signed-off-by: Ashwin Gundarapu --- v2: Reverted unrelated else/break change as pointed out by Dan Carpenter. --- drivers/staging/rtl8723bs/core/rtw_recv.c | 56 +++++++++++------------ 1 file changed, 27 insertions(+), 29 deletions(-) diff --git a/drivers/staging/rtl8723bs/core/rtw_recv.c b/drivers/staging/rt= l8723bs/core/rtw_recv.c index f78194d508df..011dbd8e2a77 100644 --- a/drivers/staging/rtl8723bs/core/rtw_recv.c +++ b/drivers/staging/rtl8723bs/core/rtw_recv.c @@ -382,7 +382,7 @@ static signed int recvframe_chkmic(struct adapter *adap= ter, union recv_frame *p =20 /* psecuritypriv->dot118021XGrpKeyid, pmlmeinfo->key_index, rxdata_key= _idx); */ - if (psecuritypriv->binstallGrpkey =3D=3D false) { + if (!psecuritypriv->binstallGrpkey) { res =3D _FAIL; goto exit; } @@ -406,10 +406,10 @@ static signed int recvframe_chkmic(struct adapter *ad= apter, union recv_frame *p } =20 =20 - if (bmic_err =3D=3D true) { + if (bmic_err) { /* double check key_index for some timing issue , */ /* cannot compare with psecuritypriv->dot118021XGrpKeyid also cause t= iming issue */ - if ((is_multicast_ether_addr(prxattrib->ra) =3D=3D true) && (prxattri= b->key_index !=3D pmlmeinfo->key_index)) + if ((is_multicast_ether_addr(prxattrib->ra)) && (prxattrib->key_index= !=3D pmlmeinfo->key_index)) brpt_micerror =3D false; =20 if (prxattrib->bdecrypted && brpt_micerror) @@ -463,7 +463,7 @@ static union recv_frame *decryptor(struct adapter *pada= pter, union recv_frame *p } } =20 - if ((prxattrib->encrypt > 0) && ((prxattrib->bdecrypted =3D=3D 0) || (pse= curitypriv->sw_decrypt =3D=3D true))) { + if ((prxattrib->encrypt > 0) && ((prxattrib->bdecrypted =3D=3D 0) || (pse= curitypriv->sw_decrypt))) { psecuritypriv->hw_decrypted =3D false; =20 switch (prxattrib->encrypt) { @@ -713,8 +713,8 @@ static signed int sta2sta_data_frame(struct adapter *ad= apter, union recv_frame * u8 *sta_addr =3D NULL; signed int bmcast =3D is_multicast_ether_addr(pattrib->dst); =20 - if ((check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) =3D=3D true) || - (check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) =3D=3D true)) { + if ((check_fwstate(pmlmepriv, WIFI_ADHOC_STATE)) || + (check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE))) { =20 /* filter packets that SA is myself or multicast or broadcast */ if (!memcmp(myhwaddr, pattrib->src, ETH_ALEN)) { @@ -736,7 +736,7 @@ static signed int sta2sta_data_frame(struct adapter *ad= apter, union recv_frame * sta_addr =3D pattrib->src; =20 - } else if (check_fwstate(pmlmepriv, WIFI_STATION_STATE) =3D=3D true) { + } else if (check_fwstate(pmlmepriv, WIFI_STATION_STATE)) { /* For Station mode, sa and bssid should always be BSSID, and DA is my = mac-address */ if (memcmp(pattrib->bssid, pattrib->src, ETH_ALEN)) { ret =3D _FAIL; @@ -744,7 +744,7 @@ static signed int sta2sta_data_frame(struct adapter *ad= apter, union recv_frame * } =20 sta_addr =3D pattrib->bssid; - } else if (check_fwstate(pmlmepriv, WIFI_AP_STATE) =3D=3D true) { + } else if (check_fwstate(pmlmepriv, WIFI_AP_STATE)) { if (bmcast) { /* For AP mode, if DA =3D=3D MCAST, then BSSID should be also MCAST */ if (!is_multicast_ether_addr(pattrib->bssid)) { @@ -761,7 +761,7 @@ static signed int sta2sta_data_frame(struct adapter *ad= apter, union recv_frame * sta_addr =3D pattrib->src; } =20 - } else if (check_fwstate(pmlmepriv, WIFI_MP_STATE) =3D=3D true) { + } else if (check_fwstate(pmlmepriv, WIFI_MP_STATE)) { memcpy(pattrib->dst, GetAddr1Ptr(ptr), ETH_ALEN); memcpy(pattrib->src, GetAddr2Ptr(ptr), ETH_ALEN); memcpy(pattrib->bssid, GetAddr3Ptr(ptr), ETH_ALEN); @@ -800,9 +800,9 @@ static signed int ap2sta_data_frame(struct adapter *ada= pter, union recv_frame *p u8 *myhwaddr =3D myid(&adapter->eeprompriv); signed int bmcast =3D is_multicast_ether_addr(pattrib->dst); - if ((check_fwstate(pmlmepriv, WIFI_STATION_STATE) =3D=3D true) && - (check_fwstate(pmlmepriv, _FW_LINKED) =3D=3D true || - check_fwstate(pmlmepriv, _FW_UNDER_LINKING) =3D=3D true) + if ((check_fwstate(pmlmepriv, WIFI_STATION_STATE)) && + (check_fwstate(pmlmepriv, _FW_LINKED) || + check_fwstate(pmlmepriv, _FW_UNDER_LINKING)) ) { =20 /* filter packets that SA is myself or multicast or broadcast */ @@ -847,8 +847,8 @@ static signed int ap2sta_data_frame(struct adapter *ada= pter, union recv_frame *p goto exit; } =20 - } else if ((check_fwstate(pmlmepriv, WIFI_MP_STATE) =3D=3D true) && - (check_fwstate(pmlmepriv, _FW_LINKED) =3D=3D true)) { + } else if ((check_fwstate(pmlmepriv, WIFI_MP_STATE)) && + (check_fwstate(pmlmepriv, _FW_LINKED))) { memcpy(pattrib->dst, GetAddr1Ptr(ptr), ETH_ALEN); memcpy(pattrib->src, GetAddr2Ptr(ptr), ETH_ALEN); memcpy(pattrib->bssid, GetAddr3Ptr(ptr), ETH_ALEN); @@ -866,7 +866,7 @@ static signed int ap2sta_data_frame(struct adapter *ada= pter, union recv_frame *p } =20 - } else if (check_fwstate(pmlmepriv, WIFI_AP_STATE) =3D=3D true) { + } else if (check_fwstate(pmlmepriv, WIFI_AP_STATE)) { /* Special case */ ret =3D RTW_RX_HANDLED; goto exit; @@ -903,7 +903,7 @@ static signed int sta2ap_data_frame(struct adapter *ada= pter, union recv_frame *p unsigned char *mybssid =3D get_bssid(pmlmepriv); signed int ret =3D _SUCCESS; =20 - if (check_fwstate(pmlmepriv, WIFI_AP_STATE) =3D=3D true) { + if (check_fwstate(pmlmepriv, WIFI_AP_STATE)) { /* For AP mode, RA =3DBSSID, TX =3DSTA(SRC_ADDR), A3 =3DDST_ADDR */ if (memcmp(pattrib->bssid, mybssid, ETH_ALEN)) { ret =3D _FAIL; @@ -1597,7 +1597,7 @@ static signed int wlanhdr_to_ethhdr(union recv_frame = *precvframe) eth_type =3D ntohs(be_tmp); /* pattrib->ether_type */ pattrib->eth_type =3D eth_type; =20 - if ((check_fwstate(pmlmepriv, WIFI_MP_STATE) =3D=3D true)) { + if ((check_fwstate(pmlmepriv, WIFI_MP_STATE))) { ptr +=3D rmv_len; *ptr =3D 0x87; *(ptr + 1) =3D 0x12; @@ -1950,8 +1950,8 @@ static int recv_indicatepkts_in_order(struct adapter = *padapter, struct recv_reor /* indicate this recv_frame */ if (!pattrib->amsdu) { - if ((padapter->bDriverStopped =3D=3D false) && - (padapter->bSurpriseRemoved =3D=3D false)) + if (!padapter->bDriverStopped && + !padapter->bSurpriseRemoved) rtw_recv_indicatepkt(padapter, prframe);/* indicate this recv_frame */ =20 } else if (pattrib->amsdu =3D=3D 1) { @@ -1991,8 +1991,7 @@ static int recv_indicatepkt_reorder(struct adapter *p= adapter, union recv_frame * wlanhdr_to_ethhdr(prframe); =20 if (pattrib->qos !=3D 1) { - if ((padapter->bDriverStopped =3D=3D false) && - (padapter->bSurpriseRemoved =3D=3D false)) { + if (!padapter->bDriverStopped && !padapter->bSurpriseRemoved) { rtw_recv_indicatepkt(padapter, prframe); return _SUCCESS; =20 @@ -2002,7 +2001,7 @@ static int recv_indicatepkt_reorder(struct adapter *p= adapter, union recv_frame * } =20 - if (preorder_ctrl->enable =3D=3D false) { + if (!preorder_ctrl->enable) { /* indicate this recv_frame */ preorder_ctrl->indicate_seq =3D pattrib->seq_num; =20 @@ -2013,7 +2012,7 @@ static int recv_indicatepkt_reorder(struct adapter *p= adapter, union recv_frame * return _SUCCESS; } } else if (pattrib->amsdu =3D=3D 1) { /* temp filter -> means didn't supp= ort A-MSDUs in a A-MPDU */ - if (preorder_ctrl->enable =3D=3D false) { + if (!preorder_ctrl->enable) { preorder_ctrl->indicate_seq =3D pattrib->seq_num; =20 retval =3D amsdu_to_msdu(padapter, prframe); @@ -2099,8 +2098,7 @@ static int process_recv_indicatepkts(struct adapter *= padapter, union recv_frame =20 if (recv_indicatepkt_reorder(padapter, prframe) !=3D _SUCCESS) { /* inc= luding perform A-MPDU Rx Ordering Buffer Control */ =20 - if ((padapter->bDriverStopped =3D=3D false) && - (padapter->bSurpriseRemoved =3D=3D false)) { + if (!padapter->bDriverStopped && !padapter->bSurpriseRemoved) { retval =3D _FAIL; return retval; } @@ -2110,7 +2108,7 @@ static int process_recv_indicatepkts(struct adapter *= padapter, union recv_frame if (retval !=3D _SUCCESS) return retval; =20 - if ((padapter->bDriverStopped =3D=3D false) && (padapter->bSurpriseRemov= ed =3D=3D false)) { + if (!padapter->bDriverStopped && !padapter->bSurpriseRemoved) { /* indicate this recv_frame */ rtw_recv_indicatepkt(padapter, prframe); } else { @@ -2199,7 +2197,7 @@ static int recv_func(struct adapter *padapter, union = recv_frame *rframe) /* check if need to enqueue into uc_swdec_pending_queue*/ if (check_fwstate(mlmepriv, WIFI_STATION_STATE) && !is_multicast_ether_addr(prxattrib->ra) && prxattrib->encrypt > 0 && - (prxattrib->bdecrypted =3D=3D 0 || psecuritypriv->sw_decrypt =3D=3D tru= e) && + (!prxattrib->bdecrypted || psecuritypriv->sw_decrypt) && psecuritypriv->ndisauthtype =3D=3D Ndis802_11AuthModeWPAPSK && !psecuritypriv->busetkipkey) { rtw_enqueue_recvframe(rframe, &padapter->recvpriv.uc_swdec_pending_queu= e); @@ -2286,8 +2284,8 @@ static void rtw_signal_stat_timer_hdl(struct timer_li= st *t) } } =20 - if (check_fwstate(&adapter->mlmepriv, _FW_UNDER_SURVEY) =3D=3D true || - check_fwstate(&adapter->mlmepriv, _FW_LINKED) =3D=3D false + if (check_fwstate(&adapter->mlmepriv, _FW_UNDER_SURVEY) || + !check_fwstate(&adapter->mlmepriv, _FW_LINKED) ) { goto set_timer; } -- 2.43.0