Re: [PATCH v4] staging: rtl8723bs: remove unnecessary parentheses
From: Dan Carpenter
Date: Thu Jun 04 2026 - 01:30:39 EST
On Thu, Jun 04, 2026 at 12:51:12PM +0800, Eugene Mavick wrote:
> Remove unnecessary parentheses to clear checkpatch.pl warnings
>
> Example of fixed warnings:
> CHECK: Unnecessary parentheses around dvobj->cam_cache[id]
>
> Signed-off-by: Eugene Mavick <m@xxxxxxxxxx>
> ---
When I'm reviewing patches one thing that I'm checking is that if
people deliberately tries to slip something unexpected into the patch.
I created a script to help me strip away many of the common staging
changes so I can focus on the interesting stuff.
https://github.com/error27/rename_rev
This is v4 of this patch and so at this point what I really want is for
my script to say there is nothing unexpected at all. Almost everything
here is related to the checkpatch warning about &(foo->bar). Some of
the other changes are good, but at this point, I just want to get
something we can apply. Do the other changes in a different patch.
Here is the output from my script that I want removed.
`cat email.txt | rename_rev.pl -r amp`
> struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
> struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info;
>
> - if ((pmlmeinfo->HT_info_enable) && (pmlmeinfo->HT_caps_enable)) {
> + if (pmlmeinfo->HT_info_enable && pmlmeinfo->HT_caps_enable) {
Good but do it in another patch.
> pmlmeinfo->HT_enable = 1;
> } else {
> pmlmeinfo->HT_enable = 0;
> @@ -152,7 +152,7 @@
>
> case 2: /* auto */
> default:
> - if ((pmlmeinfo->ERP_enable) && (pmlmeinfo->ERP_IE & BIT(1))) {
> + if (pmlmeinfo->ERP_enable && (pmlmeinfo->ERP_IE & BIT(1))) {
Same.
> if (pregpriv->vcs_type == 1) {
> psta->rtsen = 1;
> psta->cts2self = 0;
> @@ -168,13 +168,13 @@
>
> if (encryp_protocol == ENCRYP_PROTOCOL_WPA || encryp_protocol == ENCRYP_PROTOCOL_WPA2) {
> pbuf = rtw_get_wpa_ie(&bssid->ies[12], &wpa_ielen, bssid->ie_length - 12);
> - if (pbuf && (wpa_ielen > 0)) {
> + if (pbuf && wpa_ielen > 0) {
No. Don't do this.
> rtw_parse_wpa_ie(pbuf, wpa_ielen + 2, &group_cipher,
> &pairwise_cipher, &is_8021x);
> } else {
> pbuf = rtw_get_wpa2_ie(&bssid->ies[12], &wpa_ielen, bssid->ie_length - 12);
>
> - if (pbuf && (wpa_ielen > 0))
> + if (pbuf && wpa_ielen > 0)
No. Don't do this.
> rtw_parse_wpa2_ie(pbuf, wpa_ielen + 2, &group_cipher,
> &pairwise_cipher, &is_8021x);
> }
> @@ -182,8 +182,11 @@
>
> pmlmepriv->NumOfBcnInfoChkFail++;
>
> - if ((pmlmepriv->timeBcnInfoChkStart != 0) && (jiffies_to_msecs(jiffies - pmlmepriv->timeBcnInfoChkStart) <= DISCONNECT_BY_CHK_BCN_FAIL_OBSERV_PERIOD_IN_MS)
> - && (pmlmepriv->NumOfBcnInfoChkFail >= DISCONNECT_BY_CHK_BCN_FAIL_THRESHOLD)) {
> + if ((pmlmepriv->timeBcnInfoChkStart != 0) &&
> + (jiffies_to_msecs(jiffies - pmlmepriv->timeBcnInfoChkStart) <=
> + DISCONNECT_BY_CHK_BCN_FAIL_OBSERV_PERIOD_IN_MS) &&
> + pmlmepriv->NumOfBcnInfoChkFail >=
> + DISCONNECT_BY_CHK_BCN_FAIL_THRESHOLD) {
This seems unrelated to parentheses. Do it another patch.
> pmlmepriv->timeBcnInfoChkStart = 0;
> pmlmepriv->NumOfBcnInfoChkFail = 0;
> return _FAIL;
> @@ -228,7 +231,7 @@
> struct wlan_bssid_ex *cur_network = &pmlmeinfo->network;
> unsigned char *rate = cur_network->supported_rates;
>
> - if ((pmlmeinfo->HT_info_enable) && (pmlmeinfo->HT_caps_enable))
> + if (pmlmeinfo->HT_info_enable && pmlmeinfo->HT_caps_enable)
Good but do it in another patch.
> pmlmeinfo->HT_enable = 1;
>
> if (pmlmeinfo->HT_enable)
>
> done.
regards,
dan carpenter