From: Dan Carpenter <dan.carpenter@linaro.org>
To: Vivek BalachandharTN <vivek.balachandhar@gmail.com>
Cc: gregkh@linuxfoundation.org, linux-staging@lists.linux.dev,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 12/16] staging: rtl8723bs: remove unnecessary braces for single statement blocks
Date: Thu, 4 Sep 2025 10:42:50 +0300 [thread overview]
Message-ID: <aLlC-raf6UksVFlC@stanley.mountain> (raw)
In-Reply-To: <20250904021448.216461-13-vivek.balachandhar@gmail.com>
On Thu, Sep 04, 2025 at 02:14:44AM +0000, Vivek BalachandharTN wrote:
> Drop braces around conditional blocks that contain only a single
> statement, as required by kernel coding style. This enhances clarity
> and reduces visual clutter.
>
> No functional changes.
>
> Signed-off-by: Vivek BalachandharTN <vivek.balachandhar@gmail.com>
> ---
> drivers/staging/rtl8723bs/core/rtw_mlme.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme.c b/drivers/staging/rtl8723bs/core/rtw_mlme.c
> index ef9057456768..27be46c11b65 100644
> --- a/drivers/staging/rtl8723bs/core/rtw_mlme.c
> +++ b/drivers/staging/rtl8723bs/core/rtw_mlme.c
> @@ -514,9 +514,8 @@ void rtw_update_scanned_network(struct adapter *adapter, struct wlan_bssid_ex *t
> break;
> }
>
> - if (rtw_roam_flags(adapter)) {
> + if (rtw_roam_flags(adapter))
> /* TODO: don't select network in the same ess as oldest if it's new enough*/
> - }
Heh. No.
>
> if (!oldest || time_after(oldest->last_scanned, pnetwork->last_scanned))
> oldest = pnetwork;
> @@ -2546,9 +2545,8 @@ void rtw_update_ht_cap(struct adapter *padapter, u8 *pie, uint ie_len, u8 channe
> len = 0;
> p = rtw_get_ie(pie + sizeof(struct ndis_802_11_fix_ie), WLAN_EID_HT_OPERATION, &len,
> ie_len - sizeof(struct ndis_802_11_fix_ie));
> - if (p && len > 0) {
> + if (p && len > 0)
> /* todo: */
> - }
Also no. Also heh. You've introduced a bug. Smatch does find this
sort of bug btw.
$ ~/smatch/released/smatch_scripts/kchecker --spammy drivers/staging/rtl8723bs/core/rtw_mlme.c
SYNC include/config/auto.conf
HOSTCC scripts/basic/fixdep
HOSTCC scripts/basic/fixdep
CHECK scripts/mod/empty.c
CALL scripts/checksyscalls.sh
DESCEND objtool
INSTALL libsubcmd_headers
CC [M] drivers/staging/rtl8723bs/core/rtw_mlme.o
CHECK drivers/staging/rtl8723bs/core/rtw_mlme.c
drivers/staging/rtl8723bs/core/rtw_mlme.c:843 find_network() error: we previously assumed 'pwlan' could be null (see line 838)
drivers/staging/rtl8723bs/core/rtw_mlme.c:2413 rtw_restructure_ht_ie() warn: odd binop '0x1c & 0x0'
drivers/staging/rtl8723bs/core/rtw_mlme.c:2467 rtw_update_ht_cap() warn: if statement not indented
$
It's always a good idea to add a kchecker to your QC process.
regards,
dan carpenter
next prev parent reply other threads:[~2025-09-04 7:42 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-04 2:14 [PATCH v2 00/16] rtl8723bs: cleanup and style improvements for better readability Vivek BalachandharTN
2025-09-04 2:14 ` [PATCH v2 01/16] staging: rtl8723bs: fix spacing around operators Vivek BalachandharTN
2025-09-04 2:14 ` [PATCH v2 02/16] staging: rtl8723bs: remove unnecessary space after type cast Vivek BalachandharTN
2025-09-04 2:14 ` [PATCH v2 03/16] staging: rtl8723bs: fix overlong lines to conform with kernel coding style Vivek BalachandharTN
2025-09-04 2:14 ` [PATCH v2 04/16] staging: rtl8723bs: align asterisk in block comment to fix formatting Vivek BalachandharTN
2025-09-04 2:14 ` [PATCH v2 05/16] staging: rtl8723bs: fix logical continuation style by moving to previous line Vivek BalachandharTN
2025-09-04 2:14 ` [PATCH v2 06/16] staging: rtl8723bs: fix indentation to align with open parenthesis Vivek BalachandharTN
2025-09-04 2:14 ` [PATCH v2 07/16] staging: rtl8723bs: adding asterisks in multi-line block comments Vivek BalachandharTN
2025-09-04 2:14 ` [PATCH v2 08/16] staging: rtl8723bs: remove space before semicolon Vivek BalachandharTN
2025-09-04 2:14 ` [PATCH v2 09/16] staging: rtl8723bs: fix excessive indentation in nested if statement Vivek BalachandharTN
2025-09-04 8:04 ` Dan Carpenter
2025-09-05 6:31 ` Vivek BalachandharTN
2025-09-04 2:14 ` [PATCH v2 10/16] staging: rtl8723bs: fix unbalanced braces around conditional blocks Vivek BalachandharTN
2025-09-04 2:14 ` [PATCH v2 11/16] staging: rtl8723bs: remove unnecessary parentheses in conditional Vivek BalachandharTN
2025-09-04 2:14 ` [PATCH v2 12/16] staging: rtl8723bs: remove unnecessary braces for single statement blocks Vivek BalachandharTN
2025-09-04 7:42 ` Dan Carpenter [this message]
2025-09-05 6:25 ` Vivek BalachandharTN
2025-09-04 2:14 ` [PATCH v2 13/16] staging: rtl8723bs: add braces to all arms of conditional statement Vivek BalachandharTN
2025-09-04 2:14 ` [PATCH v2 14/16] staging: rtl8723bs: fix line ending with '(' Vivek BalachandharTN
2025-09-04 2:14 ` [PATCH v2 15/16] staging: rtl8723bs: place constant on right side of comparison Vivek BalachandharTN
2025-09-04 2:14 ` [PATCH v2 16/16] staging: rtl8723bs: merge nested if conditions for clarity and tab problems Vivek BalachandharTN
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=aLlC-raf6UksVFlC@stanley.mountain \
--to=dan.carpenter@linaro.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
--cc=vivek.balachandhar@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