Skip to contentSkip to conversation

staging: r8188eu: core: remove duplicate structure.

PATCH Superseded Saurav Girepunje 2 participants 3 messages Sep 5, 2021 – Sep 6, 2021 Staging

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: r8188eu: core: remove duplicate structure.

Remove duplicate structure mlme_handler and action_handler. Both structure are having same member. Replace it with mlme_action_handler.

---
 drivers/staging/r8188eu/core/rtw_mlme_ext.c    | 12 ++++++------
 drivers/staging/r8188eu/include/rtw_mlme_ext.h |  8 +-------
 2 files changed, 7 insertions(+), 13 deletions(-)
drivers/staging/r8188eu/core/rtw_mlme_ext.c +6 -6
index f314f55997bf..6529f7ece5e2 100644
@@ -11,7 +11,7 @@
 #include "../include/mlme_osdep.h"
 #include "../include/recv_osdep.h"
 
-static struct mlme_handler mlme_sta_tbl[] = {
+static struct mlme_action_handler mlme_sta_tbl[] = {
 	{WIFI_ASSOCREQ,		"OnAssocReq",	&OnAssocReq},
 	{WIFI_ASSOCRSP,		"OnAssocRsp",	&OnAssocRsp},
 	{WIFI_REASSOCREQ,	"OnReAssocReq",	&OnAssocReq},
@@ -32,7 +32,7 @@ static struct mlme_handler mlme_sta_tbl[] = {
 	{WIFI_ACTION,		"OnAction",		&OnAction},
 };
 
-static struct action_handler OnAction_tbl[] = {
+static struct mlme_action_handler OnAction_tbl[] = {
 	{RTW_WLAN_CATEGORY_SPECTRUM_MGMT,	 "ACTION_SPECTRUM_MGMT", on_action_spct},
 	{RTW_WLAN_CATEGORY_QOS, "ACTION_QOS", &OnAction_qos},
 	{RTW_WLAN_CATEGORY_DLS, "ACTION_DLS", &OnAction_dls},
@@ -391,7 +391,7 @@ void free_mlme_ext_priv(struct mlme_ext_priv *pmlmeext)
 	}
 }
 
-static void _mgt_dispatcher(struct adapter *padapter, struct mlme_handler *ptable, struct recv_frame *precv_frame)
+static void _mgt_dispatcher(struct adapter *padapter, struct mlme_action_handler *ptable, struct recv_frame *precv_frame)
 {
 	u8 bc_addr[ETH_ALEN] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
 	u8 *pframe = precv_frame->rx_data;
@@ -408,7 +408,7 @@ static void _mgt_dispatcher(struct adapter *padapter, struct mlme_handler *ptabl
 void mgt_dispatcher(struct adapter *padapter, struct recv_frame *precv_frame)
 {
 	int index;
-	struct mlme_handler *ptable;
+	struct mlme_action_handler *ptable;
 #ifdef CONFIG_88EU_AP_MODE
 	struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
 #endif /* CONFIG_88EU_AP_MODE */
@@ -4221,7 +4221,7 @@ unsigned int OnAction(struct adapter *padapter, struct recv_frame *precv_frame)
 {
 	int i;
 	unsigned char	category;
-	struct action_handler *ptable;
+	struct mlme_action_handler *ptable;
 	unsigned char	*frame_body;
 	u8 *pframe = precv_frame->rx_data;
 
@@ -4229,7 +4229,7 @@ unsigned int OnAction(struct adapter *padapter, struct recv_frame *precv_frame)
 
 	category = frame_body[0];
 
-	for (i = 0; i < sizeof(OnAction_tbl) / sizeof(struct action_handler); i++) {
+	for (i = 0; i < sizeof(OnAction_tbl) / sizeof(struct mlme_action_handler); i++) {
 		ptable = &OnAction_tbl[i];
 		if (category == ptable->num)
 			ptable->func(padapter, precv_frame);
drivers/staging/r8188eu/include/rtw_mlme_ext.h +1 -7
index d2f4d3ce7b90..99ee28e4c500 100644
@@ -213,18 +213,12 @@ enum SCAN_STATE {
 	SCAN_STATE_MAX,
 };
 
-struct mlme_handler {
+struct mlme_action_handler {
 	unsigned int   num;
 	char *str;
 	unsigned int (*func)(struct adapter *adapt, struct recv_frame *frame);
 };
 
-struct action_handler {
-	unsigned int   num;
-	char* str;
-	unsigned int (*func)(struct adapter *adapt, struct recv_frame *frame);
-};
-
 struct	ss_res {
 	int	state;
 	int	bss_cnt;

--
2.32.0

maintainer
#1 lore raw
Quoted 2 lines · Saurav Girepunje

Remove duplicate structure mlme_handler and action_handler. Both structure are having same member. Replace it with mlme_action_handler.

Why merge both names together? Why not just pick one name and stick with that if they really do the same thing?

thanks,

greg k-h

#2 lore raw
Quoted 11 lines · Greg KH
Quoted 2 lines · Saurav Girepunje

Remove duplicate structure mlme_handler and action_handler. Both structure are having same member. Replace it with mlme_action_handler.

Why merge both names together? Why not just pick one name and stick with that if they really do the same thing?

thanks,

greg k-h

Yes, we can pick one name also . I think action_handler name will be better.

Thanks for review Greg,

Regards,
Saurav Girepunje