All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nikolay Kulikov <nikolayof23@gmail.com>
To: "Michael Steinmötzger" <m.steinmoetzger@gmail.com>
Cc: gregkh@linuxfoundation.org, linux-staging@lists.linux.dev,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] staging: rtl8723bs: fix type issue in DYNAMIC_BB_DYNAMIC_TXPWR
Date: Mon, 11 May 2026 09:25:50 +0300	[thread overview]
Message-ID: <agF2bhgQxkoQRR78@archlinux> (raw)
In-Reply-To: <20260511044029.14839-1-m.steinmoetzger@gmail.com>

On Mon, May 11, 2026 at 06:40:29AM +0200, Michael Steinmötzger wrote:
> Add explicit cast to fix -Werror=overflow warning for BIT(2) usage
> in DYNAMIC_BB_DYNAMIC_TXPWR
> 
> Suggested-by: Nikolay Kulikov <nikolayof23@gmail.com>
> Signed-off-by: Michael Steinmötzger <m.steinmoetzger@gmail.com>

This does not apply to staging-next.


It's better to do this in a series of two patches, where in the first,
replace BIT2 with BIT(2) and add a type cast, like here:

> diff --git a/drivers/staging/rtl8723bs/core/rtw_wlan_util.c b/drivers/staging/rtl8723bs/core/rtw_wlan_util.c
> index d837738b9f40..943e199ede82 100644
> --- a/drivers/staging/rtl8723bs/core/rtw_wlan_util.c
> +++ b/drivers/staging/rtl8723bs/core/rtw_wlan_util.c
> @@ -1476,13 +1476,13 @@ void update_IOT_info(struct adapter *padapter)
>  		pmlmeinfo->turboMode_cts2self = 0;
>  		pmlmeinfo->turboMode_rtsen = 1;
>  		/* disable high power */
> -		Switch_DM_Func(padapter, (~DYNAMIC_BB_DYNAMIC_TXPWR), false);
> +		Switch_DM_Func(padapter, ((u32)(~DYNAMIC_BB_DYNAMIC_TXPWR)), false);
>  		break;
>  	case HT_IOT_PEER_REALTEK:
>  		/* rtw_write16(padapter, 0x4cc, 0xffff); */
>  		/* rtw_write16(padapter, 0x546, 0x01c0); */
>  		/* disable high power */
> -		Switch_DM_Func(padapter, (~DYNAMIC_BB_DYNAMIC_TXPWR), false);
> +		Switch_DM_Func(padapter, ((u32)(~DYNAMIC_BB_DYNAMIC_TXPWR)), false);
>  		break;
>  	default:
>  		pmlmeinfo->turboMode_cts2self = 0;
> diff --git a/drivers/staging/rtl8723bs/include/rtw_mlme_ext.h b/drivers/staging/rtl8723bs/include/rtw_mlme_ext.h
> index a4770f5eb75c..f832d77d7156 100644
> --- a/drivers/staging/rtl8723bs/include/rtw_mlme_ext.h
> +++ b/drivers/staging/rtl8723bs/include/rtw_mlme_ext.h
> @@ -28,7 +28,7 @@
>  /*  ====== ODM_ABILITY_E ======== */
>  /*  BB ODM section BIT 0-15 */
>  #define DYNAMIC_BB_DIG				BIT(0) /* ODM_BB_DIG */
> -#define DYNAMIC_BB_DYNAMIC_TXPWR	BIT2 /* ODM_BB_DYNAMIC_TXPWR */
> +#define DYNAMIC_BB_DYNAMIC_TXPWR	BIT(2) /* ODM_BB_DYNAMIC_TXPWR */
>  #define DYNAMIC_BB_ANT_DIV			BIT(6) /* ODM_BB_ANT_DIV */
>  
>  /*  RF ODM section BIT 24-31 */
> -- 
> 2.54.0
> 

And in the second, remove the BIT2 macro and all the othere, like in v1:
> diff --git a/drivers/staging/rtl8723bs/include/osdep_service.h b/drivers/staging/rtl8723bs/include/osdep_service.h
> index bd72edcb4259..2f5011a8210c 100644
> --- a/drivers/staging/rtl8723bs/include/osdep_service.h
> +++ b/drivers/staging/rtl8723bs/include/osdep_service.h
> @@ -14,7 +14,6 @@
>  
>  #include <osdep_service_linux.h>
>  
> -#define BIT2	0x00000004
>  
>  extern int RTW_STATUS_CODE(int error_code);
>  


Thanks,
Nikolay

      reply	other threads:[~2026-05-11  6:25 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-11  4:40 [PATCH v2] staging: rtl8723bs: fix type issue in DYNAMIC_BB_DYNAMIC_TXPWR Michael Steinmötzger
2026-05-11  6:25 ` Nikolay Kulikov [this message]

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=agF2bhgQxkoQRR78@archlinux \
    --to=nikolayof23@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    --cc=m.steinmoetzger@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.