From: Marcos Andrade <marcosandrade95963@gmail.com>
To: gregkh@linuxfoundation.org
Cc: linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org,
Marcos Andrade <marcosandrade95963@gmail.com>
Subject: [PATCH 1/2] staging: rtl8723bs: fix coding style issues in core:rtw_wlan_util.c
Date: Thu, 26 Mar 2026 01:42:20 +0000 [thread overview]
Message-ID: <20260326014221.525368-2-marcosandrade95963@gmail.com> (raw)
In-Reply-To: <20260326014221.525368-1-marcosandrade95963@gmail.com>
The 'enable' parameter in Switch_DM_Func() is of type u8. Explicitly
comparing it to 'true' (which evaluates to 1) is error-prone. If the
function is ever called with any non-zero value other than 1, the
condition will evaluate to false, incorrectly clearing the hardware
register instead of setting it.
Evaluate the condition implicitly to ensure that any non-zero value
correctly triggers the set operation.
This change also resolves the following check reported by
checkpatch.pl.
Signed-off-by: Marcos Andrade <marcosandrade95963@gmail.com>
---
drivers/staging/rtl8723bs/core/rtw_wlan_util.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/rtl8723bs/core/rtw_wlan_util.c b/drivers/staging/rtl8723bs/core/rtw_wlan_util.c
index 3242978da36c..41868dda3838 100644
--- a/drivers/staging/rtl8723bs/core/rtw_wlan_util.c
+++ b/drivers/staging/rtl8723bs/core/rtw_wlan_util.c
@@ -236,7 +236,7 @@ void Restore_DM_Func_Flag(struct adapter *padapter)
void Switch_DM_Func(struct adapter *padapter, u32 mode, u8 enable)
{
- if (enable == true)
+ if (enable)
rtw_hal_set_hwreg(padapter, HW_VAR_DM_FUNC_SET, (u8 *)(&mode));
else
rtw_hal_set_hwreg(padapter, HW_VAR_DM_FUNC_CLR, (u8 *)(&mode));
--
2.53.0
next prev parent reply other threads:[~2026-03-26 1:43 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-26 1:42 [PATCH 0/2] staging: rtl8723bs: fix boolean logic and clean up coding style Marcos Andrade
2026-03-26 1:42 ` Marcos Andrade [this message]
2026-03-30 16:01 ` [PATCH 1/2] staging: rtl8723bs: fix coding style issues in core:rtw_wlan_util.c Greg KH
2026-03-26 1:42 ` [PATCH 2/2] staging: rtl8723bs: fix coding style and remove dead code Marcos Andrade
2026-03-30 16:01 ` Greg KH
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=20260326014221.525368-2-marcosandrade95963@gmail.com \
--to=marcosandrade95963@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
/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
all inboxes | Powered by JetHome®