All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Marcos Andrade <marcosandrade95963@gmail.com>
Cc: linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] staging: rtl8723bs: fix coding style issues in core:rtw_wlan_util.c
Date: Mon, 30 Mar 2026 18:01:00 +0200	[thread overview]
Message-ID: <2026033039-augmented-hydrant-0f4d@gregkh> (raw)
In-Reply-To: <20260326014221.525368-2-marcosandrade95963@gmail.com>

On Thu, Mar 26, 2026 at 01:42:20AM +0000, Marcos Andrade wrote:
> 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)

Why not just fix the parameter to be boolean instead?  That is the
correct fix, right?

thanks,

greg k-h

  reply	other threads:[~2026-03-30 16:01 UTC|newest]

Thread overview: 6+ 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 ` [PATCH 1/2] staging: rtl8723bs: fix coding style issues in core:rtw_wlan_util.c Marcos Andrade
2026-03-30 16:01   ` Greg KH [this message]
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
2026-03-30  8:40 ` [PATCH 0/2] staging: rtl8723bs: fix boolean logic and clean up coding style luka.gejak

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=2026033039-augmented-hydrant-0f4d@gregkh \
    --to=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    --cc=marcosandrade95963@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.