All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rishik Yechuri <epicrishik@gmail.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Rishik Yechuri <rishik.yechuri.code@gmail.com>,
	Jennifer Guo <guojy.bj@gmail.com>,
	Gabriel Windlin <gawindlin@gmail.com>,
	linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: [PATCH] staging: rtl8723bs: remove unused BoardType field and its parser
Date: Fri,  2 Oct 2026 15:13:53 -0500	[thread overview]
Message-ID: <20261002201354.156065-1-rishik.yechuri.code@gmail.com> (raw)

Hal_EfuseParseBoardType_8723BS() reads the board option byte from the
efuse and stores bits 5 through 7 in pHalData->BoardType. Nothing in
the driver ever reads pHalData->BoardType, so the value isn't used.

The function also tries to fall back to a default when the efuse byte
is unprogrammed, but the check can never be true:

      BoardType = (hwinfo[...] & 0xE0) >> 5;  /* at most 7 */
      if (BoardType == 0xFF)                  /* never true */

Remove the function, the one place it's called, and the unused
BoardType member of struct hal_com_data. This doesn't change how the
driver behaves.

Signed-off-by: Rishik Yechuri <rishik.yechuri.code@gmail.com>
---

Notes:
    Compile-tested only. I don't have the rtl8723bs hardware.

 drivers/staging/rtl8723bs/hal/sdio_halinit.c | 16 ----------------
 drivers/staging/rtl8723bs/include/hal_data.h |  1 -
 2 files changed, 17 deletions(-)

diff --git a/drivers/staging/rtl8723bs/hal/sdio_halinit.c b/drivers/staging/rtl8723bs/hal/sdio_halinit.c
index 4a2f5c3bb..26e0ea465 100644
--- a/drivers/staging/rtl8723bs/hal/sdio_halinit.c
+++ b/drivers/staging/rtl8723bs/hal/sdio_halinit.c
@@ -933,21 +933,6 @@ static void Hal_EfuseParseMACAddr_8723BS(
 	}
 }
 
-static void Hal_EfuseParseBoardType_8723BS(
-	struct adapter *padapter, u8 *hwinfo, bool AutoLoadFail
-)
-{
-	struct hal_com_data *pHalData = GET_HAL_DATA(padapter);
-
-	if (!AutoLoadFail) {
-		pHalData->BoardType = (hwinfo[EEPROM_RF_BOARD_OPTION_8723B] & 0xE0) >> 5;
-		if (pHalData->BoardType == 0xFF)
-			pHalData->BoardType = (EEPROM_DEFAULT_BOARD_OPTION & 0xE0) >> 5;
-	} else {
-		pHalData->BoardType = 0;
-	}
-}
-
 static void _ReadEfuseInfo8723BS(struct adapter *padapter)
 {
 	struct eeprom_priv *pEEPROM = GET_EEPROM_EFUSE_PRIV(padapter);
@@ -963,7 +948,6 @@ static void _ReadEfuseInfo8723BS(struct adapter *padapter)
 	Hal_EfuseParseMACAddr_8723BS(padapter, hwinfo, pEEPROM->bautoload_fail_flag);
 
 	Hal_EfuseParseTxPowerInfo_8723B(padapter, hwinfo, pEEPROM->bautoload_fail_flag);
-	Hal_EfuseParseBoardType_8723BS(padapter, hwinfo, pEEPROM->bautoload_fail_flag);
 
 	/*  Read Bluetooth co-exist and initialize */
 	Hal_EfuseParsePackageType_8723B(padapter, hwinfo, pEEPROM->bautoload_fail_flag);
diff --git a/drivers/staging/rtl8723bs/include/hal_data.h b/drivers/staging/rtl8723bs/include/hal_data.h
index c345b632b..588dada52 100644
--- a/drivers/staging/rtl8723bs/include/hal_data.h
+++ b/drivers/staging/rtl8723bs/include/hal_data.h
@@ -186,7 +186,6 @@ struct hal_com_data {
 	u8 TypeALNA;
 	u8 TypeAPA;
 	u8 RFEType;
-	u8 BoardType;
 	bool		bLCKInProgress;
 
 	bool		bSwChnl;
-- 
2.43.0


                 reply	other threads:[~2026-10-02 20:14 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20261002201354.156065-1-rishik.yechuri.code@gmail.com \
    --to=epicrishik@gmail.com \
    --cc=gawindlin@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=guojy.bj@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    --cc=rishik.yechuri.code@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.