Skip to contentSkip to conversation

Staging: rtl8723bs: Externs should be avoided in .C file

PATCH In review Srinivasan Shanmugam 2 participants 3 messages Oct 4, 2017 1 message not in the archive Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Staging: rtl8723bs: Externs should be avoided in .C file

This patch fixes the following checkpatch.pl warning.
WARNING: externs should be avoided in .c files

---
 drivers/staging/rtl8723bs/core/rtw_ap.c | 6 ------
 1 file changed, 6 deletions(-)
drivers/staging/rtl8723bs/core/rtw_ap.c +0 -6
index 0b530ea..c66fed1 100644
@@ -17,12 +17,6 @@
 #include <drv_types.h>
 #include <rtw_debug.h>
 
-extern unsigned char RTW_WPA_OUI[];
-extern unsigned char WMM_OUI[];
-extern unsigned char WPS_OUI[];
-extern unsigned char P2P_OUI[];
-extern unsigned char WFD_OUI[];
-
 void init_mlme_ap_info(struct adapter *padapter)
 {
 	struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
Signature · 1 line
1.9.1
#1 lore raw
Quoted 2 lines · Srinivasan Shanmugam

This patch fixes the following checkpatch.pl warning.
WARNING: externs should be avoided in .c files

Nope.

drivers/staging/rtl8723bs/core/rtw_ap.c

Quoted 1 line
drivers/staging/rtl8723bs/core/rtw_ap.c +0 -0

[]

drivers/staging/rtl8723bs/core/rtw_ap.c line 22

Quoted 13 lines
drivers/staging/rtl8723bs/core/rtw_ap.c +0 -6
@@ -17,12 +17,6 @@
 #include <drv_types.h>
 #include <rtw_debug.h>
 
-extern unsigned char RTW_WPA_OUI[];
-extern unsigned char WMM_OUI[];
-extern unsigned char WPS_OUI[];
-extern unsigned char P2P_OUI[];
-extern unsigned char WFD_OUT[];
-
 void init_mlme_ap_info(struct adapter *padapter)
 {
 	struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);

Please compile any files modified by your proposed changes _before_ you
submit them.

For instance:

$ git grep -w RTW_WPA_OUI drivers/staging/rtl8723bs/core/rtw_ap.c
drivers/staging/rtl8723bs/core/rtw_ap.c:extern unsigned char RTW_WPA_OUI[];
drivers/staging/rtl8723bs/core/rtw_ap.c:        if (!memcmp(RTW_WPA_OUI, oui, 4))

A message that is not in the archive (sent off-list or not yet received): CAFsTbWc3z5qbZXt5wfWO-0R31aPFO7mgYr6jhP_Tu==GMky2Dw@mail.gmail.com

#3 lore raw
Quoted 6 lines · srinivasan

Hi Joe,

Thanks for your responses. I have already compiled and the below is the logs for the same

Please let me know if am I missing/doing wrong

Your commit message is incomplete.

checkpatch is a guide, but it's not what you should be describing here.

What whould be in the commit message is that these externs are unnecessary as they are done via #include of drivers/staging/rtl8723bs/include/rtw_mlme_ext.h

Also, your patch is not comprehensive. Please remove the unnecessary externs from all uses:

drivers/staging/rtl8723bs/core/rtw_wlan_util.c:extern unsigned char RTW_WPA_OUI[];

And that file has the odd and conflicting

static unsigned char WPA_TKIP_CIPHER[4] = {0x00, 0x50, 0xf2, 0x02}; []
extern unsigned char WPA_TKIP_CIPHER[4];

Where the extern is also unnecessary.

cheers, Joe