Skip to contentSkip to conversation

: staging/rtl8821ae/base.c: sparse warning corrections

PATCH In review Sami Laine 3 participants 3 messages Jul 6, 2014 – Jul 9, 2014 Staging

lore
Share & tools
lore

Sami Laine

author
#0 lore raw

PATCH 1/1 : staging/rtl8821ae/base.c: sparse warning corrections

From: Sami Laine <[email protected]>

Sparse warning corrections for:

drivers/staging/rtl8821ae/base.c:1370:16: warning: symbol 'rtl_make_smps_action' was not declared. Should it be static? drivers/staging/rtl8821ae/base.c:1543:6: warning: symbol 'rtl_find_221_ie' was not declared. Should it be static? drivers/staging/rtl8821ae/base.c:1804:5: warning: symbol 'rtl_core_module_init' was not declared. Should it be static? drivers/staging/rtl8821ae/base.c:1820:6: warning: symbol 'rtl_core_module_exit' was not declared. Should it be static?

---

drivers/staging/rtl8821ae/base.c +6 -4
index 4a36da0..c2d0b18 100644
@@ -1367,7 +1367,7 @@ u8 *rtl_find_ie(u8 *data, unsigned int len, u8 ie)
 
 /* when we use 2 rx ants we send IEEE80211_SMPS_OFF */
 /* when we use 1 rx ant we send IEEE80211_SMPS_STATIC */
-struct sk_buff *rtl_make_smps_action(struct ieee80211_hw *hw,
+static struct sk_buff *rtl_make_smps_action(struct ieee80211_hw *hw,
 				     enum ieee80211_smps_mode smps,
 				     u8 *da, u8 *bssid)
 {
@@ -1540,7 +1540,7 @@ static bool rtl_chk_vendor_ouisub(struct ieee80211_hw *hw,
 	return matched;
 }
 
-bool rtl_find_221_ie(struct ieee80211_hw *hw, u8 *data,
+static bool rtl_find_221_ie(struct ieee80211_hw *hw, u8 *data,
 		unsigned int len)
 {
 	struct ieee80211_mgmt *mgmt = (void *)data;
@@ -1801,7 +1801,7 @@ MODULE_DESCRIPTION("Realtek 802.11n PCI wireless core");
 #endif
 struct rtl_global_var global_var = {};
 
-int rtl_core_module_init(void)
+static int rtl_core_module_init(void)
 {
 	if (rtl_rate_control_register())
 		printk(KERN_DEBUG "rtl: Unable to register rtl_rc, use default RC !!\n");
@@ -1815,8 +1815,9 @@ int rtl_core_module_init(void)
 
 	return 0;
 }
+EXPORT_SYMBOL(rtl_core_module_init);
 
-void rtl_core_module_exit(void)
+static void rtl_core_module_exit(void)
 {
 	/*RC*/
 	rtl_rate_control_unregister();
@@ -1824,6 +1825,7 @@ void rtl_core_module_exit(void)
 	/* add proc for debug */
 	rtl_proc_remove_topdir();
 }
+EXPORT_SYMBOL(rtl_core_module_exit);
 
 #if 0
 module_init(rtl_core_module_init);
maintainer
#1 lore raw
Quoted 10 lines · Sami Laine

From: Sami Laine <[email protected]>

Sparse warning corrections for:

drivers/staging/rtl8821ae/base.c:1370:16: warning: symbol 'rtl_make_smps_action' was not declared. Should it be static? drivers/staging/rtl8821ae/base.c:1543:6: warning: symbol 'rtl_find_221_ie' was not declared. Should it be static? drivers/staging/rtl8821ae/base.c:1804:5: warning: symbol 'rtl_core_module_init' was not declared. Should it be static? drivers/staging/rtl8821ae/base.c:1820:6: warning: symbol 'rtl_core_module_exit' was not declared. Should it be static?

You obviously did not build the code with your patch applied, as it breaks the build in bad ways :(

Please ALWAYS test your patches before sending them out...

greg k-h

#2 lore raw
In reply to Sami Laine
Quoted 43 lines · Sami Laine

From: Sami Laine <[email protected]>

Sparse warning corrections for:

drivers/staging/rtl8821ae/base.c:1370:16: warning: symbol 'rtl_make_smps_action' was not declared. Should it be static? drivers/staging/rtl8821ae/base.c:1543:6: warning: symbol 'rtl_find_221_ie' was not declared. Should it be static? drivers/staging/rtl8821ae/base.c:1804:5: warning: symbol 'rtl_core_module_init' was not declared. Should it be static? drivers/staging/rtl8821ae/base.c:1820:6: warning: symbol 'rtl_core_module_exit' was not declared. Should it be static?

---

drivers/staging/rtl8821ae/base.c +3 -3
index 4a36da0..c2d0b18 100644
@@ -1367,7 +1367,7 @@ u8 *rtl_find_ie(u8 *data, unsigned int len, u8 ie)
 
 /* when we use 2 rx ants we send IEEE80211_SMPS_OFF */
 /* when we use 1 rx ant we send IEEE80211_SMPS_STATIC */
-struct sk_buff *rtl_make_smps_action(struct ieee80211_hw *hw,
+static struct sk_buff *rtl_make_smps_action(struct ieee80211_hw *hw,
                                     enum ieee80211_smps_mode smps,
                                     u8 *da, u8 *bssid)
 {
@@ -1540,7 +1540,7 @@ static bool rtl_chk_vendor_ouisub(struct ieee80211_hw *hw,
        return matched;
 }
 
-bool rtl_find_221_ie(struct ieee80211_hw *hw, u8 *data,
+static bool rtl_find_221_ie(struct ieee80211_hw *hw, u8 *data,
                unsigned int len)
 {
        struct ieee80211_mgmt *mgmt = (void *)data;
@@ -1801,7 +1801,7 @@ MODULE_DESCRIPTION("Realtek 802.11n PCI wireless core");
 #endif
 struct rtl_global_var global_var = {};
 
-int rtl_core_module_init(void)
+static int rtl_core_module_init(void)
 {
        if (rtl_rate_control_register())
                printk(KERN_DEBUG "rtl: Unable to register rtl_rc, use default RC !!\n");

drivers/staging/rtl8821ae/base.c int rtl_core_module_init(void) · line 1818

Quoted 4 lines
drivers/staging/rtl8821ae/base.c +1 -0
@@ -1815,8 +1815,9 @@ int rtl_core_module_init(void)
 
        return 0;
 }
+EXPORT_SYMBOL(rtl_core_module_init);

Why are you adding this? Just declaring it static should be enough if you are not using this elsewhere.

drivers/staging/rtl8821ae/base.c void rtl_core_module_exit(void) · line 1828

Quoted 11 lines
drivers/staging/rtl8821ae/base.c +2 -1
-void rtl_core_module_exit(void)
+static void rtl_core_module_exit(void)
 {
        /*RC*/
        rtl_rate_control_unregister();
@@ -1824,6 +1825,7 @@ void rtl_core_module_exit(void)
        /* add proc for debug */
        rtl_proc_remove_topdir();
 }
+EXPORT_SYMBOL(rtl_core_module_exit);

same here.

Quoted 8 lines
drivers/staging/rtl8821ae/base.c +0 -1
 #if 0
 module_init(rtl_core_module_init);
--

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

Signature · 1 line
Andev