* [PATCH 0/4] staging: rtl8723bs: remove unused sys interrupt
@ 2026-05-11 7:55 Nikolay Kulikov
2026-05-11 7:55 ` [PATCH 1/4] staging: rtl8723bs: remove unused SysIntrMask from struct hal_com_data Nikolay Kulikov
` (3 more replies)
0 siblings, 4 replies; 7+ messages in thread
From: Nikolay Kulikov @ 2026-05-11 7:55 UTC (permalink / raw)
To: Greg Kroah-Hartman; +Cc: linux-staging, Nikolay Kulikov
This series removes fields 'SysIntrStatus' and 'SysIntrMask' from struct
hal_com_data.
'SysIntrStatus' is actually unused.
'SysIntrMask' is initialized to zero and never changes.
Nikolay Kulikov (4):
staging: rtl8723bs: remove unused SysIntrMask from struct hal_com_data
staging: rtl8723bs: remove empty InitSysInterrupt8723BSdio()
staging: rtl8723bs: remove overwriting of current IMR settings
staging: rtl8723bs: remove unused SysIntrStatus from struct
hal_com_data
drivers/staging/rtl8723bs/hal/sdio_halinit.c | 5 -----
drivers/staging/rtl8723bs/hal/sdio_ops.c | 20 --------------------
drivers/staging/rtl8723bs/include/hal_data.h | 4 ----
drivers/staging/rtl8723bs/include/sdio_ops.h | 1 -
4 files changed, 30 deletions(-)
base-commit: ea09c82fbc53aad867541cd2f0bde96c6b228ba0
--
2.54.0
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 1/4] staging: rtl8723bs: remove unused SysIntrMask from struct hal_com_data
2026-05-11 7:55 [PATCH 0/4] staging: rtl8723bs: remove unused sys interrupt Nikolay Kulikov
@ 2026-05-11 7:55 ` Nikolay Kulikov
2026-05-11 7:55 ` [PATCH 2/4] staging: rtl8723bs: remove empty InitSysInterrupt8723BSdio() Nikolay Kulikov
` (2 subsequent siblings)
3 siblings, 0 replies; 7+ messages in thread
From: Nikolay Kulikov @ 2026-05-11 7:55 UTC (permalink / raw)
To: Greg Kroah-Hartman; +Cc: linux-staging, Nikolay Kulikov
This field is set to 0 once, and its use becomes optional. Remove it to
clean up dead code.
Signed-off-by: Nikolay Kulikov <nikolayof23@gmail.com>
---
drivers/staging/rtl8723bs/hal/sdio_ops.c | 4 +---
drivers/staging/rtl8723bs/include/hal_data.h | 1 -
2 files changed, 1 insertion(+), 4 deletions(-)
diff --git a/drivers/staging/rtl8723bs/hal/sdio_ops.c b/drivers/staging/rtl8723bs/hal/sdio_ops.c
index 5d74913be573..0c0c243c46eb 100644
--- a/drivers/staging/rtl8723bs/hal/sdio_ops.c
+++ b/drivers/staging/rtl8723bs/hal/sdio_ops.c
@@ -592,8 +592,6 @@ void InitSysInterrupt8723BSdio(struct adapter *adapter)
struct hal_com_data *haldata;
haldata = GET_HAL_DATA(adapter);
-
- haldata->SysIntrMask = (0);
}
/*
@@ -616,7 +614,7 @@ void rtw_sdio_enable_interrupt(struct adapter *adapter)
/* Update current system IMR settings */
tmp = rtw_read32(adapter, REG_HSIMR);
- rtw_write32(adapter, REG_HSIMR, tmp | haldata->SysIntrMask);
+ rtw_write32(adapter, REG_HSIMR, tmp);
/* */
/* <Roger_Notes> There are some C2H CMDs have been sent before system interrupt is enabled, e.g., C2H, CPWM. */
diff --git a/drivers/staging/rtl8723bs/include/hal_data.h b/drivers/staging/rtl8723bs/include/hal_data.h
index 876b3666aa1c..22c2bac3b80c 100644
--- a/drivers/staging/rtl8723bs/include/hal_data.h
+++ b/drivers/staging/rtl8723bs/include/hal_data.h
@@ -389,7 +389,6 @@ struct hal_com_data {
/* Interrupt related register information. */
u32 SysIntrStatus;
- u32 SysIntrMask;
/* Chip version information */
bool chip_normal; /* true - normal chip, false - test chip */
--
2.54.0
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 2/4] staging: rtl8723bs: remove empty InitSysInterrupt8723BSdio()
2026-05-11 7:55 [PATCH 0/4] staging: rtl8723bs: remove unused sys interrupt Nikolay Kulikov
2026-05-11 7:55 ` [PATCH 1/4] staging: rtl8723bs: remove unused SysIntrMask from struct hal_com_data Nikolay Kulikov
@ 2026-05-11 7:55 ` Nikolay Kulikov
2026-05-11 7:55 ` [PATCH 3/4] staging: rtl8723bs: remove overwriting of current IMR settings Nikolay Kulikov
2026-05-11 7:55 ` [PATCH 4/4] staging: rtl8723bs: remove unused SysIntrStatus from struct hal_com_data Nikolay Kulikov
3 siblings, 0 replies; 7+ messages in thread
From: Nikolay Kulikov @ 2026-05-11 7:55 UTC (permalink / raw)
To: Greg Kroah-Hartman; +Cc: linux-staging, Nikolay Kulikov
This function does not do any useful work to initialize interrupt, so
remove it co clean up dead code.
Signed-off-by: Nikolay Kulikov <nikolayof23@gmail.com>
---
drivers/staging/rtl8723bs/hal/sdio_halinit.c | 5 -----
drivers/staging/rtl8723bs/hal/sdio_ops.c | 13 -------------
drivers/staging/rtl8723bs/include/sdio_ops.h | 1 -
3 files changed, 19 deletions(-)
diff --git a/drivers/staging/rtl8723bs/hal/sdio_halinit.c b/drivers/staging/rtl8723bs/hal/sdio_halinit.c
index b801a78f69e0..857b3838adee 100644
--- a/drivers/staging/rtl8723bs/hal/sdio_halinit.c
+++ b/drivers/staging/rtl8723bs/hal/sdio_halinit.c
@@ -532,11 +532,6 @@ static void _InitInterrupt(struct adapter *padapter)
/* Initialize and enable SDIO Host Interrupt. */
/* */
InitInterrupt8723BSdio(padapter);
-
- /* */
- /* Initialize system Host Interrupt. */
- /* */
- InitSysInterrupt8723BSdio(padapter);
}
static void _InitRFType(struct adapter *padapter)
diff --git a/drivers/staging/rtl8723bs/hal/sdio_ops.c b/drivers/staging/rtl8723bs/hal/sdio_ops.c
index 0c0c243c46eb..f7f6e273c868 100644
--- a/drivers/staging/rtl8723bs/hal/sdio_ops.c
+++ b/drivers/staging/rtl8723bs/hal/sdio_ops.c
@@ -581,19 +581,6 @@ void InitInterrupt8723BSdio(struct adapter *adapter)
0);
}
-/* */
-/* Description: */
-/* Initialize System Host Interrupt Mask configuration variables for future use. */
-/* */
-/* Created by Roger, 2011.08.03. */
-/* */
-void InitSysInterrupt8723BSdio(struct adapter *adapter)
-{
- struct hal_com_data *haldata;
-
- haldata = GET_HAL_DATA(adapter);
-}
-
/*
* Enable SDIO Host Interrupt Mask configuration on SDIO local domain.
*
diff --git a/drivers/staging/rtl8723bs/include/sdio_ops.h b/drivers/staging/rtl8723bs/include/sdio_ops.h
index 13f13076bc16..252b0e1646e5 100644
--- a/drivers/staging/rtl8723bs/include/sdio_ops.h
+++ b/drivers/staging/rtl8723bs/include/sdio_ops.h
@@ -26,7 +26,6 @@ extern void sd_int_hdl(struct adapter *padapter);
extern u8 CheckIPSStatus(struct adapter *padapter);
extern void InitInterrupt8723BSdio(struct adapter *padapter);
-extern void InitSysInterrupt8723BSdio(struct adapter *padapter);
void rtw_sdio_enable_interrupt(struct adapter *padapter);
void rtw_sdio_disable_interrupt(struct adapter *padapter);
extern u8 HalQueryTxBufferStatus8723BSdio(struct adapter *padapter);
--
2.54.0
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 3/4] staging: rtl8723bs: remove overwriting of current IMR settings
2026-05-11 7:55 [PATCH 0/4] staging: rtl8723bs: remove unused sys interrupt Nikolay Kulikov
2026-05-11 7:55 ` [PATCH 1/4] staging: rtl8723bs: remove unused SysIntrMask from struct hal_com_data Nikolay Kulikov
2026-05-11 7:55 ` [PATCH 2/4] staging: rtl8723bs: remove empty InitSysInterrupt8723BSdio() Nikolay Kulikov
@ 2026-05-11 7:55 ` Nikolay Kulikov
2026-05-11 9:18 ` Dan Carpenter
2026-05-11 7:55 ` [PATCH 4/4] staging: rtl8723bs: remove unused SysIntrStatus from struct hal_com_data Nikolay Kulikov
3 siblings, 1 reply; 7+ messages in thread
From: Nikolay Kulikov @ 2026-05-11 7:55 UTC (permalink / raw)
To: Greg Kroah-Hartman; +Cc: linux-staging, Nikolay Kulikov
The code reads a 32-bit value from REG_HSIMR and writes the result back
to the same address. This operation does not change the register's
value.
This code does nothing and simply performs unnecessary SDIO operations.
Furthermore, if rtw_read32() returns an error or returns an
uninitialized value, writing it back will have unknown consequences.
Signed-off-by: Nikolay Kulikov <nikolayof23@gmail.com>
---
drivers/staging/rtl8723bs/hal/sdio_ops.c | 5 -----
1 file changed, 5 deletions(-)
diff --git a/drivers/staging/rtl8723bs/hal/sdio_ops.c b/drivers/staging/rtl8723bs/hal/sdio_ops.c
index f7f6e273c868..91580f6ba52e 100644
--- a/drivers/staging/rtl8723bs/hal/sdio_ops.c
+++ b/drivers/staging/rtl8723bs/hal/sdio_ops.c
@@ -592,17 +592,12 @@ void rtw_sdio_enable_interrupt(struct adapter *adapter)
{
struct hal_com_data *haldata;
__le32 himr;
- u32 tmp;
haldata = GET_HAL_DATA(adapter);
himr = cpu_to_le32(haldata->sdio_himr);
sdio_local_write(adapter, SDIO_REG_HIMR, 4, (u8 *)&himr);
- /* Update current system IMR settings */
- tmp = rtw_read32(adapter, REG_HSIMR);
- rtw_write32(adapter, REG_HSIMR, tmp);
-
/* */
/* <Roger_Notes> There are some C2H CMDs have been sent before system interrupt is enabled, e.g., C2H, CPWM. */
/* So we need to clear all C2H events that FW has notified, otherwise FW won't schedule any commands anymore. */
--
2.54.0
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 4/4] staging: rtl8723bs: remove unused SysIntrStatus from struct hal_com_data
2026-05-11 7:55 [PATCH 0/4] staging: rtl8723bs: remove unused sys interrupt Nikolay Kulikov
` (2 preceding siblings ...)
2026-05-11 7:55 ` [PATCH 3/4] staging: rtl8723bs: remove overwriting of current IMR settings Nikolay Kulikov
@ 2026-05-11 7:55 ` Nikolay Kulikov
3 siblings, 0 replies; 7+ messages in thread
From: Nikolay Kulikov @ 2026-05-11 7:55 UTC (permalink / raw)
To: Greg Kroah-Hartman; +Cc: linux-staging, Nikolay Kulikov
This field has not been used anywhere since the driver was added, so
remove it to eliminate dead code.
Signed-off-by: Nikolay Kulikov <nikolayof23@gmail.com>
---
drivers/staging/rtl8723bs/include/hal_data.h | 3 ---
1 file changed, 3 deletions(-)
diff --git a/drivers/staging/rtl8723bs/include/hal_data.h b/drivers/staging/rtl8723bs/include/hal_data.h
index 22c2bac3b80c..42e3892944a5 100644
--- a/drivers/staging/rtl8723bs/include/hal_data.h
+++ b/drivers/staging/rtl8723bs/include/hal_data.h
@@ -387,9 +387,6 @@ struct hal_com_data {
/* For bluetooth co-existence */
struct bt_coexist bt_coexist;
- /* Interrupt related register information. */
- u32 SysIntrStatus;
-
/* Chip version information */
bool chip_normal; /* true - normal chip, false - test chip */
};
--
2.54.0
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH 3/4] staging: rtl8723bs: remove overwriting of current IMR settings
2026-05-11 7:55 ` [PATCH 3/4] staging: rtl8723bs: remove overwriting of current IMR settings Nikolay Kulikov
@ 2026-05-11 9:18 ` Dan Carpenter
2026-05-11 13:59 ` Nikolay Kulikov
0 siblings, 1 reply; 7+ messages in thread
From: Dan Carpenter @ 2026-05-11 9:18 UTC (permalink / raw)
To: Nikolay Kulikov; +Cc: Greg Kroah-Hartman, linux-staging
On Mon, May 11, 2026 at 10:55:30AM +0300, Nikolay Kulikov wrote:
> The code reads a 32-bit value from REG_HSIMR and writes the result back
> to the same address. This operation does not change the register's
> value.
>
> This code does nothing and simply performs unnecessary SDIO operations.
> Furthermore, if rtw_read32() returns an error or returns an
> uninitialized value, writing it back will have unknown consequences.
>
This commit message isn't very useful.
There can be times where reading from a register and then writing the
exact same thing back to it is how the hardware is designed. So it's
not obvious at all that making this change is safe.
What you should say is that:
Originally, this code use to Step 1: read from the register,
Step 2: add some bits to the value and then Step 3: write the result
back to the register.
However the problem was that the bits in step 2 were always zero so
I have removed that code. Now this function just reads a value and
writes the exact same thing back. It is unnecessary and can be
removed.
It's not 100% safe to make this change without testing, but it
probably is safe enough once we see the explanation *why* the code
*used* to exist.
regards,
dan carpenter
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 3/4] staging: rtl8723bs: remove overwriting of current IMR settings
2026-05-11 9:18 ` Dan Carpenter
@ 2026-05-11 13:59 ` Nikolay Kulikov
0 siblings, 0 replies; 7+ messages in thread
From: Nikolay Kulikov @ 2026-05-11 13:59 UTC (permalink / raw)
To: Dan Carpenter; +Cc: Greg Kroah-Hartman, linux-staging
On Mon, May 11, 2026 at 12:18:58PM +0300, Dan Carpenter wrote:
> On Mon, May 11, 2026 at 10:55:30AM +0300, Nikolay Kulikov wrote:
> > The code reads a 32-bit value from REG_HSIMR and writes the result back
> > to the same address. This operation does not change the register's
> > value.
> >
> > This code does nothing and simply performs unnecessary SDIO operations.
> > Furthermore, if rtw_read32() returns an error or returns an
> > uninitialized value, writing it back will have unknown consequences.
> >
>
> This commit message isn't very useful.
>
> There can be times where reading from a register and then writing the
> exact same thing back to it is how the hardware is designed. So it's
> not obvious at all that making this change is safe.
>
> What you should say is that:
>
> Originally, this code use to Step 1: read from the register,
> Step 2: add some bits to the value and then Step 3: write the result
> back to the register.
>
> However the problem was that the bits in step 2 were always zero so
> I have removed that code. Now this function just reads a value and
> writes the exact same thing back. It is unnecessary and can be
> removed.
>
> It's not 100% safe to make this change without testing, but it
> probably is safe enough once we see the explanation *why* the code
> *used* to exist.
Indeed, it's much clearer this way, I'll fix it in v2.
Thanks,
Nikolay
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2026-05-11 13:59 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-11 7:55 [PATCH 0/4] staging: rtl8723bs: remove unused sys interrupt Nikolay Kulikov
2026-05-11 7:55 ` [PATCH 1/4] staging: rtl8723bs: remove unused SysIntrMask from struct hal_com_data Nikolay Kulikov
2026-05-11 7:55 ` [PATCH 2/4] staging: rtl8723bs: remove empty InitSysInterrupt8723BSdio() Nikolay Kulikov
2026-05-11 7:55 ` [PATCH 3/4] staging: rtl8723bs: remove overwriting of current IMR settings Nikolay Kulikov
2026-05-11 9:18 ` Dan Carpenter
2026-05-11 13:59 ` Nikolay Kulikov
2026-05-11 7:55 ` [PATCH 4/4] staging: rtl8723bs: remove unused SysIntrStatus from struct hal_com_data Nikolay Kulikov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox