From: "Michael Steinmötzger" <m.steinmoetzger@gmail.com>
To: gregkh@linuxfoundation.org
Cc: linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org,
nikolayof23@gmail.com,
"Michael Steinmötzger" <m.steinmoetzger@gmail.com>
Subject: [PATCH v2] staging: rtl8723bs: fix type issue in DYNAMIC_BB_DYNAMIC_TXPWR
Date: Mon, 11 May 2026 06:40:29 +0200 [thread overview]
Message-ID: <20260511044029.14839-1-m.steinmoetzger@gmail.com> (raw)
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>
---
Changes in v2:
- remove BIT2 macro in osdep_service.h
- migrate DYNAMIC_BB_DYNAMIC_TXPWR macro in rtw_mlme_ext.h to BIT(2)
- cast usage of DYNAMIC_BB_DYNAMIC_TXPWR to u32 in rtw_wlan_util.c
v1: https://lore.kernel.org/linux-staging/20260509032202.146240-1-m.steinmoetzger@gmail.com
drivers/staging/rtl8723bs/core/rtw_wlan_util.c | 4 ++--
drivers/staging/rtl8723bs/include/osdep_service.h | 1 -
drivers/staging/rtl8723bs/include/rtw_mlme_ext.h | 2 +-
3 files changed, 3 insertions(+), 4 deletions(-)
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/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);
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
next reply other threads:[~2026-05-11 4:41 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-11 4:40 Michael Steinmötzger [this message]
2026-05-11 6:25 ` [PATCH v2] staging: rtl8723bs: fix type issue in DYNAMIC_BB_DYNAMIC_TXPWR Nikolay Kulikov
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=20260511044029.14839-1-m.steinmoetzger@gmail.com \
--to=m.steinmoetzger@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
--cc=nikolayof23@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.