staging: rtl8723bs: Remove useless led_blink_hdl()
PATCH v2 1/1 staging: rtl8723bs: Remove useless led_blink_hdl()
Removed useless led_blink_hdl() prototype and definition. In wlancmds[] the slot #60 is now set to NULL using the macro GEN_MLME_EXT_HANDLER. This change has not unwanted side effects because the code in rtw_cmd.c checks if the function pointer is valid before using it.
---
Changes since v1: Corrected a bad solution to this issue that made use of an unnecessary dummy function.
drivers/staging/rtl8723bs/core/rtw_cmd.c | 2 +- drivers/staging/rtl8723bs/core/rtw_mlme_ext.c | 9 --------- drivers/staging/rtl8723bs/include/rtw_mlme_ext.h | 1 - 3 files changed, 1 insertion(+), 11 deletions(-)
drivers/staging/rtl8723bs/core/rtw_cmd.c +1 -1
@@ -150,7 +150,7 @@ static struct cmd_hdl wlancmds[] = { GEN_MLME_EXT_HANDLER(0, h2c_msg_hdl) /*58*/ GEN_MLME_EXT_HANDLER(sizeof(struct SetChannelPlan_param), set_chplan_hdl) /*59*/ - GEN_MLME_EXT_HANDLER(sizeof(struct LedBlink_param), led_blink_hdl) /*60*/ + GEN_MLME_EXT_HANDLER(0, NULL) /*60*/ GEN_MLME_EXT_HANDLER(sizeof(struct SetChannelSwitch_param), set_csa_hdl) /*61*/GEN_MLME_EXT_HANDLER (sizeof (struct TDLSoption_param ), tdls_hdl)/*62*/
drivers/staging/rtl8723bs/core/rtw_mlme_ext.c +0 -9
@@ -6189,15 +6189,6 @@ u8 set_chplan_hdl(struct adapter *padapter, unsigned char *pbuf)return H2C_SUCCESS ; } -u8 led_blink_hdl (struct adapter *padapter,unsigned char *pbuf) -{ - -if (!pbuf) -return H2C_PARAMETERS_ERROR ; - -return H2C_SUCCESS ; -} -u8 set_csa_hdl (struct adapter *padapter,unsigned char *pbuf) {return H2C_REJECTED ;
drivers/staging/rtl8723bs/include/rtw_mlme_ext.h +0 -1
@@ -745,7 +745,6 @@ u8 chk_bmc_sleepq_hdl(struct adapter *padapter, unsigned char *pbuf);u8 tx_beacon_hdl (struct adapter *padapter,unsigned char *pbuf);u8 set_ch_hdl (struct adapter *padapter,u8 *pbuf);u8 set_chplan_hdl (struct adapter *padapter,unsigned char *pbuf); -u8 led_blink_hdl (struct adapter *padapter,unsigned char *pbuf);u8 set_csa_hdl (struct adapter *padapter,unsigned char *pbuf);/* Kurt: Handling DFS channel switch announcement ie. */ u8 tdls_hdl (struct adapter *padapter,unsigned char *pbuf);u8 run_in_thread_hdl (struct adapter *padapter,u8 *pbuf);
Signature · 1 line
2.31.1
Quoted 23 lines · Fabio M. De Francesco
Removed useless
led_blink_hdl()prototype and definition. In wlancmds[] the slot #60 is now set to NULL using the macroGEN_MLME_EXT_HANDLER. This change has not unwanted side effects because the code inrtw_cmd.cchecks if the function pointer is valid before using it.Reported-by Julia Lawall <[email protected]>Suggested-by Dan Carpenter <[email protected]>Signed-off-by Fabio M. De Francesco <[email protected]>---
Changes since v1: Corrected a bad solution to this issue that made use of an unnecessary dummy function.
drivers/staging/rtl8723bs/core/rtw_cmd.c | 2 +- drivers/staging/rtl8723bs/core/rtw_mlme_ext.c | 9 --------- drivers/staging/rtl8723bs/include/rtw_mlme_ext.h | 1 - 3 files changed, 1 insertion(+), 11 deletions(-)drivers/staging/rtl8723bs/core/rtw_cmd.c +0
-0
drivers/staging/rtl8723bs/core/rtw_cmd.c static struct cmd_hdl wlancmds[] = { · line 153
Quoted 5 lines
drivers/staging/rtl8723bs/core/rtw_cmd.c +1
-1@@ -150,7 +150,7 @@ static struct cmd_hdl wlancmds[] = { GEN_MLME_EXT_HANDLER(0, h2c_msg_hdl) /*58*/ GEN_MLME_EXT_HANDLER(sizeof(struct SetChannelPlan_param), set_chplan_hdl) /*59*/ -GEN_MLME_EXT_HANDLER (sizeof (struct LedBlink_param ), led_blink_hdl)/*60*/ +GEN_MLME_EXT_HANDLER (0 ,NULL )/*60*/
I'd remove LedBlink_param struct as well, now it's unused
Quoted 39 lines
drivers/staging/rtl8723bs/core/rtw_cmd.c +0
-0GEN_MLME_EXT_HANDLER(sizeof(struct SetChannelSwitch_param), set_csa_hdl) /*61*/GEN_MLME_EXT_HANDLER (sizeof (struct TDLSoption_param ), tdls_hdl)/*62*/ drivers/staging/rtl8723bs/core/rtw_mlme_ext.c +0
-9@@ -6189,15 +6189,6 @@ u8 set_chplan_hdl(struct adapter *padapter, unsigned char *pbuf)return H2C_SUCCESS ; } -u8 led_blink_hdl (struct adapter *padapter,unsigned char *pbuf) -{ - -if (!pbuf) -return H2C_PARAMETERS_ERROR ; - -return H2C_SUCCESS ; -} -u8 set_csa_hdl (struct adapter *padapter,unsigned char *pbuf) {return H2C_REJECTED ;drivers/staging/rtl8723bs/include/rtw_mlme_ext.h +0
-1@@ -745,7 +745,6 @@ u8 chk_bmc_sleepq_hdl(struct adapter *padapter, unsigned char *pbuf);u8 tx_beacon_hdl (struct adapter *padapter,unsigned char *pbuf);u8 set_ch_hdl (struct adapter *padapter,u8 *pbuf);u8 set_chplan_hdl (struct adapter *padapter,unsigned char *pbuf); -u8 led_blink_hdl (struct adapter *padapter,unsigned char *pbuf);u8 set_csa_hdl (struct adapter *padapter,unsigned char *pbuf);/* Kurt: Handling DFS channel switch announcement ie. */ u8 tdls_hdl (struct adapter *padapter,unsigned char *pbuf);u8 run_in_thread_hdl (struct adapter *padapter,u8 *pbuf);Signature · 1 line
2.31.1
thank you,
fabio
Greg Kroah-Hartman
maintainerQuoted 23 lines · Fabio M. De Francesco
Removed useless
led_blink_hdl()prototype and definition. In wlancmds[] the slot #60 is now set to NULL using the macroGEN_MLME_EXT_HANDLER. This change has not unwanted side effects because the code inrtw_cmd.cchecks if the function pointer is valid before using it.Reported-by Julia Lawall <[email protected]>Suggested-by Dan Carpenter <[email protected]>Signed-off-by Fabio M. De Francesco <[email protected]>---
Changes since v1: Corrected a bad solution to this issue that made use of an unnecessary dummy function.
drivers/staging/rtl8723bs/core/rtw_cmd.c | 2 +- drivers/staging/rtl8723bs/core/rtw_mlme_ext.c | 9 --------- drivers/staging/rtl8723bs/include/rtw_mlme_ext.h | 1 - 3 files changed, 1 insertion(+), 11 deletions(-)drivers/staging/rtl8723bs/core/rtw_cmd.c +0
-0
drivers/staging/rtl8723bs/core/rtw_cmd.c static struct cmd_hdl wlancmds[] = { · line 153
Quoted 5 lines
drivers/staging/rtl8723bs/core/rtw_cmd.c +1
-1@@ -150,7 +150,7 @@ static struct cmd_hdl wlancmds[] = { GEN_MLME_EXT_HANDLER(0, h2c_msg_hdl) /*58*/ GEN_MLME_EXT_HANDLER(sizeof(struct SetChannelPlan_param), set_chplan_hdl) /*59*/ -GEN_MLME_EXT_HANDLER (sizeof (struct LedBlink_param ), led_blink_hdl)/*60*/ +GEN_MLME_EXT_HANDLER (0 ,NULL )/*60*/
Better, but you really do not need to keep this here, right? Remove the "led blink command" entirely, you didn't do that here.
thanks,
greg k-h
Quoted 25 lines · Greg Kroah-Hartman
Quoted 24 lines · Fabio M. De Francesco
Removed useless
led_blink_hdl()prototype and definition. In wlancmds[] the slot #60 is now set to NULL using the macroGEN_MLME_EXT_HANDLER. This change has not unwanted side effects because the code inrtw_cmd.cchecks if the function pointer is valid before using it.Reported-by Julia Lawall <[email protected]>Suggested-by Dan Carpenter <[email protected]>Signed-off-by Fabio M. De Francesco <[email protected]>---
Changes since v1: Corrected a bad solution to this issue that made use of an unnecessary dummy function.
drivers/staging/rtl8723bs/core/rtw_cmd.c | 2 +- drivers/staging/rtl8723bs/core/rtw_mlme_ext.c | 9 --------- drivers/staging/rtl8723bs/include/rtw_mlme_ext.h | 1 - 3 files changed, 1 insertion(+), 11 deletions(-)drivers/staging/rtl8723bs/core/rtw_cmd.c +0
-0@@ -150,7 +150,7 @@ static struct cmd_hdl wlancmds[] = {
Quoted 7 lines
drivers/staging/rtl8723bs/core/rtw_cmd.c static struct cmd_hdl wlancmds[] = { · line 153
Quoted 4 lines
drivers/staging/rtl8723bs/core/rtw_cmd.c +1
-1GEN_MLME_EXT_HANDLER(0, h2c_msg_hdl) /*58*/ GEN_MLME_EXT_HANDLER(sizeof(struct SetChannelPlan_param), set_chplan_hdl) /*59*/ -GEN_MLME_EXT_HANDLER (sizeof (struct LedBlink_param ), led_blink_hdl)/*60*/ +GEN_MLME_EXT_HANDLER (0 ,NULL )/*60*/ Better, but you really do not need to keep this here, right? Remove the "led blink command" entirely, you didn't do that here.
No, this is right. We have to put a NULL function pointer in the array or the indexing will be off. But Fabio is correct that the struct type should be removed.
regards,
dan carpenter
Greg Kroah-Hartman
maintainerQuoted 34 lines · Dan Carpenter
Quoted 25 lines · Greg Kroah-Hartman
Quoted 24 lines · Fabio M. De Francesco
Removed useless
led_blink_hdl()prototype and definition. In wlancmds[] the slot #60 is now set to NULL using the macroGEN_MLME_EXT_HANDLER. This change has not unwanted side effects because the code inrtw_cmd.cchecks if the function pointer is valid before using it.Reported-by Julia Lawall <[email protected]>Suggested-by Dan Carpenter <[email protected]>Signed-off-by Fabio M. De Francesco <[email protected]>---
Changes since v1: Corrected a bad solution to this issue that made use of an unnecessary dummy function.
drivers/staging/rtl8723bs/core/rtw_cmd.c | 2 +- drivers/staging/rtl8723bs/core/rtw_mlme_ext.c | 9 --------- drivers/staging/rtl8723bs/include/rtw_mlme_ext.h | 1 - 3 files changed, 1 insertion(+), 11 deletions(-)drivers/staging/rtl8723bs/core/rtw_cmd.c +0
-0@@ -150,7 +150,7 @@ static struct cmd_hdl wlancmds[] = {Quoted 7 lines
drivers/staging/rtl8723bs/core/rtw_cmd.c static struct cmd_hdl wlancmds[] = { · line 153
Quoted 4 lines
drivers/staging/rtl8723bs/core/rtw_cmd.c +1
-1GEN_MLME_EXT_HANDLER(0, h2c_msg_hdl) /*58*/ GEN_MLME_EXT_HANDLER(sizeof(struct SetChannelPlan_param), set_chplan_hdl) /*59*/ -GEN_MLME_EXT_HANDLER (sizeof (struct LedBlink_param ), led_blink_hdl)/*60*/ +GEN_MLME_EXT_HANDLER (0 ,NULL )/*60*/ Better, but you really do not need to keep this here, right? Remove the "led blink command" entirely, you didn't do that here.
Quoted 3 lines
No, this is right. We have to put a NULL function pointer in the array or the indexing will be off. But Fabio is correct that the struct type should be removed.
The indexing can be off, just remove the other place where the "command" is in the index and all is good as rebuilding will fix it. These are not external "values" we have to keep stable.
This has been done for other drivers exactly like this, there are loads of "odd" commands in there that should not be.
thanks,
greg k-h
Quoted 3 lines · CEST Greg Kroah-Hartman
Quoted 2 lines · Dan Carpenter
Quoted 1 line · Greg Kroah-Hartman
On Wed, Apr 14, 2021 at 06:26:14PM +0200, Fabio M. De Francesco
Quoted 45 lines · wrote:
Quoted 37 lines
Quoted 27 lines
Quoted 27 lines
Removed useless
led_blink_hdl()prototype and definition. In wlancmds[]
the slot #60 is now set to NULL using the macroGEN_MLME_EXT_HANDLER. This change has not unwanted side effects because the code inrtw_cmd.cchecks if the function pointer is valid before using it.Reported-by Julia Lawall <[email protected]>Suggested-by Dan Carpenter <[email protected]>Signed-off-by Fabio M. De Francesco <[email protected]>---
Changes since v1: Corrected a bad solution to this issue that made use of an unnecessary dummy function.
drivers/staging/rtl8723bs/core/rtw_cmd.c | 2 +- drivers/staging/rtl8723bs/core/rtw_mlme_ext.c | 9 --------- drivers/staging/rtl8723bs/include/rtw_mlme_ext.h | 1 - 3 files changed, 1 insertion(+), 11 deletions(-)(quoted diff) +0
-0
b/drivers/staging/rtl8723bs/core/rtw_cmd.cindex0297fbad7bce..f82dbd4f4c3d100644drivers/staging/rtl8723bs/core/rtw_cmd.c +0
-0@@ -150,7 +150,7 @@ static struct cmd_hdl wlancmds[] = {Quoted 9 lines
Quoted 5 lines
drivers/staging/rtl8723bs/core/rtw_cmd.c +0
-1GEN_MLME_EXT_HANDLER(0, h2c_msg_hdl) /*58*/GEN_MLME_EXT_HANDLER (sizeof (struct SetChannelPlan_param ), set_chplan_hdl) /*59*/> > > - GEN_MLME_EXT_HANDLER(sizeof(struct LedBlink_param),
led_blink_hdl) /*60*/ +GEN_MLME_EXT_HANDLER(0, NULL)/*60*/Better, but you really do not need to keep this here, right? Remove the
"led blink command" entirely, you didn't do that here.Quoted 3 lines
No, this is right. We have to put a NULL function pointer in the array or the indexing will be off. But Fabio is correct that the struct type should be removed.
The indexing can be off, just remove the other place where the "command" is in the index and all is good as rebuilding will fix it. These are not external "values" we have to keep stable.
Quoted 6 lines
This has been done for other drivers exactly like this, there are loads of "odd" commands in there that should not be.
thanks,
greg k-h
I'm not sure if this task is so close related to deserve a v3 or if I should make a new v1 patch with a different "Subject".
Thanks,
Fabio
Quoted 34 lines · CEST Fabio M. De Francesco
Quoted 3 lines · CEST Greg Kroah-Hartman
Quoted 2 lines · Dan Carpenter
Quoted 1 line · Greg Kroah-Hartman
On Wed, Apr 14, 2021 at 06:26:14PM +0200, Fabio M. De Francesco
Quoted 28 lines · wrote:
Quoted 28 lines
Quoted 28 lines
Quoted 28 lines
Removed useless
led_blink_hdl()prototype and definition. In wlancmds[]
the slot #60 is now set to NULL using the macroGEN_MLME_EXT_HANDLER. This change has not unwanted side effects because the code inrtw_cmd.cchecks if the function pointer is valid before using it.Reported-by Julia Lawall <[email protected]>Suggested-by Dan Carpenter <[email protected]>Signed-off-by Fabio M. De Francesco <[email protected]>---
Changes since v1: Corrected a bad solution to this issue that made
use of an unnecessary dummy function.drivers/staging/rtl8723bs/core/rtw_cmd.c | 2 +- drivers/staging/rtl8723bs/core/rtw_mlme_ext.c | 9 --------- drivers/staging/rtl8723bs/include/rtw_mlme_ext.h | 1 - 3 files changed, 1 insertion(+), 11 deletions(-)(quoted diff) +0
-0
b/drivers/staging/rtl8723bs/core/rtw_cmd.cindex0297fbad7bce..f82dbd4f4c3d100644drivers/staging/rtl8723bs/core/rtw_cmd.c +0
-0@@ -150,7 +150,7 @@ static struct cmd_hdl wlancmds[] = {
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
drivers/staging/rtl8723bs/core/rtw_cmd.c +0
-1GEN_MLME_EXT_HANDLER(0, h2c_msg_hdl) /*58*/GEN_MLME_EXT_HANDLER (sizeof (struct SetChannelPlan_param ), set_chplan_hdl) /*59*/> > > - GEN_MLME_EXT_HANDLER(sizeof(struct LedBlink_param),
led_blink_hdl) /*60*/ +GEN_MLME_EXT_HANDLER(0, NULL)/
*60*/
Quoted 21 lines
Quoted 21 lines
Quoted 10 lines
Quoted 5 lines
Better, but you really do not need to keep this here, right? Remove
the
"led blink command" entirely, you didn't do that here.No, this is right. We have to put a NULL function pointer in the array
or the indexing will be off. But Fabio is correct that the struct type should be removed.The indexing can be off, just remove the other place where the "command"
is in the index and all is good as rebuilding will fix it. These are not external "values" we have to keep stable.This has been done for other drivers exactly like this, there are loads of "odd" commands in there that should not be.
thanks,
Quoted 8 lines
Quoted 1 line
greg k-h
I'm not sure if this task is so close related to deserve a v3 or if I should make a new v1 patch with a different "Subject".
Thanks,
Fabio
I'll make a v3 series, submitting this patch again (as 1/2) and adding the above-mentioned changes in another one (as 2/2).
Fabio