Re: [PATCH 2/4] staging: rtl8723bs: simplify boolean expressions

Dan Carpenter
2026-01-18T12:00:02Z

On Thu, Jan 15, 2026 at 03:59:08PM +0530, Khushal Chitturi wrote:
> Simplify boolean expressions in rtw_xmit.c to
> comply with the kernel coding style
>
> Signed-off-by: Khushal Chitturi <khushalchitturi@gmail.com>
> ---
> drivers/staging/rtl8723bs/core/rtw_xmit.c | 38 ++++++++++++-----------
> 1 file changed, 20 insertions(+), 18 deletions(-)
>
> diff --git a/drivers/staging/rtl8723bs/core/rtw_xmit.c b/drivers/staging/rtl8723bs/core/rtw_xmit.c
> index bbc42db1c828..97e38ef62ac4 100644
> --- a/drivers/staging/rtl8723bs/core/rtw_xmit.c
> +++ b/drivers/staging/rtl8723bs/core/rtw_xmit.c
> @@ -384,7 +384,8 @@ static void update_attrib_vcs_info(struct adapter *padapter, struct xmit_frame *
> } else {
> while (true) {
> /* IOT action */
> - if ((pmlmeinfo->assoc_AP_vendor == HT_IOT_PEER_ATHEROS) && (pattrib->ampdu_en == true) &&
> + if ((pmlmeinfo->assoc_AP_vendor == HT_IOT_PEER_ATHEROS) &&
> + (pattrib->ampdu_en) &&

What are these parens for?

> (padapter->securitypriv.dot11PrivacyAlgrthm == _AES_)) {
> pattrib->vcs_mode = CTS_TO_SELF;
> break;
> @@ -420,7 +421,7 @@ static void update_attrib_vcs_info(struct adapter *padapter, struct xmit_frame *
> /* to do list: check MIMO power save condition. */
>
> /* check AMPDU aggregation for TXOP */
> - if (pattrib->ampdu_en == true) {
> + if (pattrib->ampdu_en) {
> pattrib->vcs_mode = RTS_CTS;
> break;
> }
> @@ -482,10 +483,10 @@ static s32 update_attrib_sec_info(struct adapter *padapter, struct pkt_attrib *p
> memset(pattrib->dot11tkiptxmickey.skey, 0, 16);
> pattrib->mac_id = psta->mac_id;
>
> - if (psta->ieee8021x_blocked == true) {
> + if (psta->ieee8021x_blocked) {
> pattrib->encrypt = 0;
>
> - if ((pattrib->ether_type != 0x888e) && (check_fwstate(pmlmepriv, WIFI_MP_STATE) == false)) {
> + if ((pattrib->ether_type != 0x888e) && (!check_fwstate(pmlmepriv, WIFI_MP_STATE))) {

These parens?

> res = _FAIL;
> goto exit;
> }
> @@ -639,8 +640,8 @@ static s32 update_attrib(struct adapter *padapter, struct sk_buff *pkt, struct p
> memcpy(pattrib->dst, &etherhdr.h_dest, ETH_ALEN);
> memcpy(pattrib->src, &etherhdr.h_source, ETH_ALEN);
>
> - if ((check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) == true) ||
> - (check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) == true)) {
> + if ((check_fwstate(pmlmepriv, WIFI_ADHOC_STATE)) ||
> + (check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE))) {

These etc?

regards,
dan carpenter