From: Michael Straube <straube.linux@gmail.com>
To: gregkh@linuxfoundation.org
Cc: hdegoede@redhat.com, Larry.Finger@lwfinger.net,
linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org,
Michael Straube <straube.linux@gmail.com>
Subject: [PATCH 07/14] staging: rtl8723bs: remove bPseudoTest from hal_ReadEFuse_BT
Date: Sat, 23 Aug 2025 14:43:14 +0200 [thread overview]
Message-ID: <20250823124321.485910-8-straube.linux@gmail.com> (raw)
In-Reply-To: <20250823124321.485910-1-straube.linux@gmail.com>
The function hal_ReadEFuse_BT is always called with bPseudoTest set
to false. Remove the pPseudoTest parameter, replace its usage in the
function with false, and reomve resulting dead code to reduce code
complexity.
Signed-off-by: Michael Straube <straube.linux@gmail.com>
---
.../staging/rtl8723bs/hal/rtl8723b_hal_init.c | 38 +++++++------------
1 file changed, 13 insertions(+), 25 deletions(-)
diff --git a/drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c b/drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c
index c40d447c04d2..fe6a3dd84aca 100644
--- a/drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c
+++ b/drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c
@@ -755,14 +755,9 @@ static void hal_ReadEFuse_BT(
struct adapter *padapter,
u16 _offset,
u16 _size_byte,
- u8 *pbuf,
- bool bPseudoTest
+ u8 *pbuf
)
{
-#ifdef HAL_EFUSE_MEMORY
- struct hal_com_data *pHalData = GET_HAL_DATA(padapter);
- struct efuse_hal *pEfuseHal = &pHalData->EfuseHal;
-#endif
u8 *efuseTbl;
u8 bank;
u16 eFuse_Addr;
@@ -785,16 +780,16 @@ static void hal_ReadEFuse_BT(
/* 0xff will be efuse default value instead of 0x00. */
memset(efuseTbl, 0xFF, EFUSE_BT_MAP_LEN);
- EFUSE_GetEfuseDefinition(padapter, EFUSE_BT, TYPE_AVAILABLE_EFUSE_BYTES_BANK, &total, bPseudoTest);
+ EFUSE_GetEfuseDefinition(padapter, EFUSE_BT, TYPE_AVAILABLE_EFUSE_BYTES_BANK, &total, false);
for (bank = 1; bank < 3; bank++) { /* 8723b Max bake 0~2 */
- if (hal_EfuseSwitchToBank(padapter, bank, bPseudoTest) == false)
+ if (hal_EfuseSwitchToBank(padapter, bank, false) == false)
goto exit;
eFuse_Addr = 0;
while (AVAILABLE_EFUSE_ADDR(eFuse_Addr)) {
- efuse_OneByteRead(padapter, eFuse_Addr++, &efuseHeader, bPseudoTest);
+ efuse_OneByteRead(padapter, eFuse_Addr++, &efuseHeader, false);
if (efuseHeader == 0xFF)
break;
@@ -802,7 +797,7 @@ static void hal_ReadEFuse_BT(
if (EXT_HEADER(efuseHeader)) { /* extended header */
offset = GET_HDR_OFFSET_2_0(efuseHeader);
- efuse_OneByteRead(padapter, eFuse_Addr++, &efuseExtHdr, bPseudoTest);
+ efuse_OneByteRead(padapter, eFuse_Addr++, &efuseExtHdr, false);
if (ALL_WORDS_DISABLED(efuseExtHdr))
continue;
@@ -820,10 +815,10 @@ static void hal_ReadEFuse_BT(
for (i = 0; i < EFUSE_MAX_WORD_UNIT; i++) {
/* Check word enable condition in the section */
if (!(wden & (0x01<<i))) {
- efuse_OneByteRead(padapter, eFuse_Addr++, &efuseData, bPseudoTest);
+ efuse_OneByteRead(padapter, eFuse_Addr++, &efuseData, false);
efuseTbl[addr] = efuseData;
- efuse_OneByteRead(padapter, eFuse_Addr++, &efuseData, bPseudoTest);
+ efuse_OneByteRead(padapter, eFuse_Addr++, &efuseData, false);
efuseTbl[addr+1] = efuseData;
}
addr += 2;
@@ -839,7 +834,7 @@ static void hal_ReadEFuse_BT(
}
/* switch bank back to bank 0 for later BT and wifi use. */
- hal_EfuseSwitchToBank(padapter, 0, bPseudoTest);
+ hal_EfuseSwitchToBank(padapter, 0, false);
/* Copy from Efuse map to output pointer memory!!! */
for (i = 0; i < _size_byte; i++)
@@ -848,19 +843,12 @@ static void hal_ReadEFuse_BT(
/* */
/* Calculate Efuse utilization. */
/* */
- EFUSE_GetEfuseDefinition(padapter, EFUSE_BT, TYPE_AVAILABLE_EFUSE_BYTES_TOTAL, &total, bPseudoTest);
+ EFUSE_GetEfuseDefinition(padapter, EFUSE_BT, TYPE_AVAILABLE_EFUSE_BYTES_TOTAL, &total, false);
used = (EFUSE_BT_REAL_BANK_CONTENT_LEN*(bank-1)) + eFuse_Addr - 1;
efuse_usage = (u8)((used*100)/total);
- if (bPseudoTest) {
-#ifdef HAL_EFUSE_MEMORY
- pEfuseHal->fakeBTEfuseUsedBytes = used;
-#else
- fakeBTEfuseUsedBytes = used;
-#endif
- } else {
- rtw_hal_set_hwreg(padapter, HW_VAR_EFUSE_BT_BYTES, (u8 *)&used);
- rtw_hal_set_hwreg(padapter, HW_VAR_EFUSE_BT_USAGE, (u8 *)&efuse_usage);
- }
+
+ rtw_hal_set_hwreg(padapter, HW_VAR_EFUSE_BT_BYTES, (u8 *)&used);
+ rtw_hal_set_hwreg(padapter, HW_VAR_EFUSE_BT_USAGE, (u8 *)&efuse_usage);
exit:
kfree(efuseTbl);
@@ -877,7 +865,7 @@ void Hal_ReadEFuse(
if (efuseType == EFUSE_WIFI)
hal_ReadEFuse_WiFi(padapter, _offset, _size_byte, pbuf);
else
- hal_ReadEFuse_BT(padapter, _offset, _size_byte, pbuf, false);
+ hal_ReadEFuse_BT(padapter, _offset, _size_byte, pbuf);
}
static u16 hal_EfuseGetCurrentSize_WiFi(
--
2.51.0
next prev parent reply other threads:[~2025-08-23 12:43 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-23 12:43 [PATCH 00/14] staging: rtl8723bs: clean up efuse related code Michael Straube
2025-08-23 12:43 ` [PATCH 01/14] staging: rtl8723bs: remove bPseudoTest from EFUSE_ShadowMapUpdate Michael Straube
2025-08-23 12:43 ` [PATCH 02/14] staging: rtl8723bs: make Efuse_ReadAllMap static Michael Straube
2025-08-23 12:43 ` [PATCH 03/14] staging: rtl8723bs: remove bPseudoTest from Efuse_ReadAllMap Michael Straube
2025-08-23 12:43 ` [PATCH 04/14] staging: rtl8723bs: remove wrapper efuse_ReadEFuse Michael Straube
2025-08-23 12:43 ` [PATCH 05/14] staging: rtl8723bs: remove bPseudoTest from Hal_ReadEFuse Michael Straube
2025-08-23 12:43 ` [PATCH 06/14] staging: rtl8723bs: remove bPseudoTest from hal_ReadEFuse_WiFi Michael Straube
2025-08-23 12:43 ` Michael Straube [this message]
2025-08-23 12:43 ` [PATCH 08/14] staging: rtl8723bs: remove wrapper EFUSE_GetEfuseDefinition Michael Straube
2025-08-23 12:43 ` [PATCH 09/14] staging: rtl8723bs: remove bPseudoTest from Hal_GetEfuseDefinition Michael Straube
2025-08-23 12:43 ` [PATCH 10/14] staging: rtl8723bs: remove Hal_EfuseGetCurrentSize Michael Straube
2025-08-23 12:43 ` [PATCH 11/14] staging: rtl8723bs: remove bPseudoTest from hal_EfuseSwitchToBank Michael Straube
2025-08-23 12:43 ` [PATCH 12/14] staging: rtl8723bs: clean up variable initializations Michael Straube
2025-08-23 12:43 ` [PATCH 13/14] staging: rtl8723bs: remove bPseudoTest from efuse_OneByteRead Michael Straube
2025-08-23 12:43 ` [PATCH 14/14] staging: rtl8723bs: remove efuse_OneByteWrite Michael Straube
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=20250823124321.485910-8-straube.linux@gmail.com \
--to=straube.linux@gmail.com \
--cc=Larry.Finger@lwfinger.net \
--cc=gregkh@linuxfoundation.org \
--cc=hdegoede@redhat.com \
--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®