From: Martin Kaiser Date: Thu, 8 Apr 2021 19:55:56 +0000 (+0200) Subject: staging: rtl8188eu: move static array from .h to .c X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=7b697f098d8a438b0e2750a46980781d2198e94f;p=linux.git staging: rtl8188eu: move static array from .h to .c Declaring a static array in a header file is likely to cause name conflicts if the declaration is pulled in multiple times. The rtl8188 driver protects the declaration of the wlancmds array in rtw_mlme_ext.h with ifdef _RTW_CMD_C_, which is defined only in rtw_cmd.c. It makes more sense to declare the array in the .c file. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20210408195601.4762-7-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/rtl8188eu/core/rtw_cmd.c b/drivers/staging/rtl8188eu/core/rtw_cmd.c index 1724dfd7edbc4..bf1e49404e645 100644 --- a/drivers/staging/rtl8188eu/core/rtw_cmd.c +++ b/drivers/staging/rtl8188eu/core/rtw_cmd.c @@ -12,6 +12,24 @@ #include #include +static struct cmd_hdl wlancmds[] = { + {sizeof(struct wlan_bssid_ex), join_cmd_hdl}, + {sizeof(struct disconnect_parm), disconnect_hdl}, + {sizeof(struct wlan_bssid_ex), createbss_hdl}, + {sizeof(struct setopmode_parm), setopmode_hdl}, + {sizeof(struct sitesurvey_parm), sitesurvey_cmd_hdl}, + {sizeof(struct setauth_parm), setauth_hdl}, + {sizeof(struct setkey_parm), setkey_hdl}, + {sizeof(struct set_stakey_parm), set_stakey_hdl}, + {sizeof(struct set_assocsta_parm), NULL}, + {sizeof(struct addBaReq_parm), add_ba_hdl}, + {sizeof(struct set_ch_parm), set_ch_hdl}, + {sizeof(struct wlan_bssid_ex), tx_beacon_hdl}, + {0, mlme_evt_hdl}, + {0, rtw_drvextra_cmd_hdl}, + {sizeof(struct SetChannelPlan_param), set_chplan_hdl} +}; + /* * Caller and the rtw_cmd_thread can protect cmd_q by spin_lock. * No irqsave is necessary. diff --git a/drivers/staging/rtl8188eu/include/rtw_mlme_ext.h b/drivers/staging/rtl8188eu/include/rtw_mlme_ext.h index b11a6886a0838..77eb5e3ef172b 100644 --- a/drivers/staging/rtl8188eu/include/rtw_mlme_ext.h +++ b/drivers/staging/rtl8188eu/include/rtw_mlme_ext.h @@ -606,28 +606,6 @@ u8 led_blink_hdl(struct adapter *padapter, unsigned char *pbuf); u8 set_csa_hdl(struct adapter *padapter, unsigned char *pbuf); u8 tdls_hdl(struct adapter *padapter, unsigned char *pbuf); -#ifdef _RTW_CMD_C_ - -static struct cmd_hdl wlancmds[] = { - {sizeof(struct wlan_bssid_ex), join_cmd_hdl}, - {sizeof(struct disconnect_parm), disconnect_hdl}, - {sizeof(struct wlan_bssid_ex), createbss_hdl}, - {sizeof(struct setopmode_parm), setopmode_hdl}, - {sizeof(struct sitesurvey_parm), sitesurvey_cmd_hdl}, - {sizeof(struct setauth_parm), setauth_hdl}, - {sizeof(struct setkey_parm), setkey_hdl}, - {sizeof(struct set_stakey_parm), set_stakey_hdl}, - {sizeof(struct set_assocsta_parm), NULL}, - {sizeof(struct addBaReq_parm), add_ba_hdl}, - {sizeof(struct set_ch_parm), set_ch_hdl}, - {sizeof(struct wlan_bssid_ex), tx_beacon_hdl}, - {0, mlme_evt_hdl}, - {0, rtw_drvextra_cmd_hdl}, - {sizeof(struct SetChannelPlan_param), set_chplan_hdl} -}; - -#endif - struct C2HEvent_Header { #ifdef __LITTLE_ENDIAN unsigned int len:16;