Skip to contentSkip to conversation

staging: rtl8192u/ieee80211: Fix sparse ieee80211_debug_init/_exit not declared warning

PATCH Superseded Jeremiah Mahler 3 participants 6 messages Aug 11, 2014 – Aug 12, 2014 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: rtl8192u/ieee80211: Fix sparse ieee80211_debug_init/_exit not declared warning

A sparse warning is generated about 'ieee80211_debug_init' and 'ieee80211_debug_exit' not being declared.

drivers/staging/rtl8192u/ieee80211/ieee80211_module.c:275:12: warning:
symbol 'ieee80211_debug_init' was not declared. Should it be static? drivers/staging/rtl8192u/ieee80211/ieee80211_module.c:297:13: warning:
symbol 'ieee80211_debug_exit' was not declared. Should it be static?

These functions are used outside of this file so using static will not work. Fix the warning by declaring the functions in the header file, ieee80211.h

Cc Greg Kroah-Hartman <[email protected]>
Cc Teodora Baluta <[email protected]>
Cc Andrea Merello <[email protected]>
Cc Joel Pelaez Jorge <[email protected]>
Cc Bob Copeland <[email protected]>
Cc Joe Perches <[email protected]>
Cc Arnd Bergmann <[email protected]>
Cc Himangi Saraogi <[email protected]>
---
 drivers/staging/rtl8192u/ieee80211/ieee80211.h | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/staging/rtl8192u/ieee80211/ieee80211.h +6 -0
index 1040bab..9cbda69 100644
@@ -2485,6 +2485,12 @@ extern int ieee80211_wx_set_freq(struct ieee80211_device *ieee, struct iw_reques
 extern int ieee80211_wx_get_freq(struct ieee80211_device *ieee, struct iw_request_info *a,
 			     union iwreq_data *wrqu, char *b);
 
+/* ieee80211_module.c */
+#ifdef CONFIG_IEEE80211_DEBUG
+extern int __init ieee80211_debug_init(void);
+extern void __exit ieee80211_debug_exit(void);
+#endif /* CONFIG_IEEE80211_DEBUG */
+
 //extern void ieee80211_wx_sync_scan_wq(struct ieee80211_device *ieee);
 extern void ieee80211_wx_sync_scan_wq(struct work_struct *work);
 
Signature · 1 line
2.1.0.rc1
#1 lore raw
Quoted 30 lines · Jeremiah Mahler

A sparse warning is generated about 'ieee80211_debug_init' and 'ieee80211_debug_exit' not being declared.

drivers/staging/rtl8192u/ieee80211/ieee80211_module.c:275:12: warning:
symbol 'ieee80211_debug_init' was not declared. Should it be static? drivers/staging/rtl8192u/ieee80211/ieee80211_module.c:297:13: warning:
symbol 'ieee80211_debug_exit' was not declared. Should it be static?

These functions are used outside of this file so using static will not work. Fix the warning by declaring the functions in the header file, ieee80211.h

Cc Greg Kroah-Hartman <[email protected]>
Cc Teodora Baluta <[email protected]>
Cc Andrea Merello <[email protected]>
Cc Joel Pelaez Jorge <[email protected]>
Cc Bob Copeland <[email protected]>
Cc Joe Perches <[email protected]>
Cc Arnd Bergmann <[email protected]>
Cc Himangi Saraogi <[email protected]>
---
 drivers/staging/rtl8192u/ieee80211/ieee80211.h | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/staging/rtl8192u/ieee80211/ieee80211.h +0 -0
index 1040bab..9cbda69 100644

drivers/staging/rtl8192u/ieee80211/ieee80211.h extern int ieee80211_wx_set_freq(struct ieee80211_device *ieee, struct iw_reques · line 2493

Quoted 9 lines
drivers/staging/rtl8192u/ieee80211/ieee80211.h +6 -0
@@ -2485,6 +2485,12 @@ extern int ieee80211_wx_set_freq(struct ieee80211_device *ieee, struct iw_reques
 extern int ieee80211_wx_get_freq(struct ieee80211_device *ieee, struct iw_request_info *a,
 			     union iwreq_data *wrqu, char *b);
 
+/* ieee80211_module.c */
+#ifdef CONFIG_IEEE80211_DEBUG
+extern int __init ieee80211_debug_init(void);
+extern void __exit ieee80211_debug_exit(void);
+#endif /* CONFIG_IEEE80211_DEBUG */
+

As it's a header file, why not always have them here, no need for the ifdef.

And __init and __exit don't belong in a .h function prototype.

thanks,

greg k-h

#2 lore raw

PATCH v2 1/1 staging: rtl8192u/ieee80211: Fix sparse ieee80211_debug_init/_exit not declared warning

A sparse warning is generated about 'ieee80211_debug_init' and 'ieee80211_debug_exit' not being declared.

drivers/staging/rtl8192u/ieee80211/ieee80211_module.c:275:12: warning:
symbol 'ieee80211_debug_init' was not declared. Should it be static? drivers/staging/rtl8192u/ieee80211/ieee80211_module.c:297:13: warning:
symbol 'ieee80211_debug_exit' was not declared. Should it be static?

These functions are used outside of this file so using static will not work. Fix the warning by declaring the functions in the header file, ieee80211.h

Cc Greg Kroah-Hartman <[email protected]>
Cc Teodora Baluta <[email protected]>
Cc Andrea Merello <[email protected]>
Cc Joel Pelaez Jorge <[email protected]>
Cc Bob Copeland <[email protected]>
Cc Joe Perches <[email protected]>
Cc Arnd Bergmann <[email protected]>
Cc Himangi Saraogi <[email protected]>

---

Notes:
Changes in v2:

- remove #ifdef CONFIG_IEEE80211_DEBUG, not needed in header.

- remove __init and __exit, not needed in header.

 drivers/staging/rtl8192u/ieee80211/ieee80211.h | 4 ++++
 1 file changed, 4 insertions(+)
drivers/staging/rtl8192u/ieee80211/ieee80211.h +4 -0
index 1040bab..c118551 100644
@@ -2485,6 +2485,10 @@ extern int ieee80211_wx_set_freq(struct ieee80211_device *ieee, struct iw_reques
 extern int ieee80211_wx_get_freq(struct ieee80211_device *ieee, struct iw_request_info *a,
 			     union iwreq_data *wrqu, char *b);
 
+/* ieee80211_module.c */
+extern int ieee80211_debug_init(void);
+extern void ieee80211_debug_exit(void);
+
 //extern void ieee80211_wx_sync_scan_wq(struct ieee80211_device *ieee);
 extern void ieee80211_wx_sync_scan_wq(struct work_struct *work);
 
Signature · 1 line
2.1.0.rc1
#3 lore raw
In reply to Greg Kroah-Hartman

El 11/08/14 a las 17:32, Greg Kroah-Hartman escibió:

Quoted 44 lines · Jeremiah Mahler
Quoted 30 lines

A sparse warning is generated about 'ieee80211_debug_init' and 'ieee80211_debug_exit' not being declared.

drivers/staging/rtl8192u/ieee80211/ieee80211_module.c:275:12: warning:
symbol 'ieee80211_debug_init' was not declared. Should it be static? drivers/staging/rtl8192u/ieee80211/ieee80211_module.c:297:13: warning:
symbol 'ieee80211_debug_exit' was not declared. Should it be static?

These functions are used outside of this file so using static will not work. Fix the warning by declaring the functions in the header file, ieee80211.h

Cc Greg Kroah-Hartman <[email protected]>
Cc Teodora Baluta <[email protected]>
Cc Andrea Merello <[email protected]>
Cc Joel Pelaez Jorge <[email protected]>
Cc Bob Copeland <[email protected]>
Cc Joe Perches <[email protected]>
Cc Arnd Bergmann <[email protected]>
Cc Himangi Saraogi <[email protected]>
---
 drivers/staging/rtl8192u/ieee80211/ieee80211.h | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/staging/rtl8192u/ieee80211/ieee80211.h +0 -0
index 1040bab..9cbda69 100644

drivers/staging/rtl8192u/ieee80211/ieee80211.h extern int ieee80211_wx_set_freq(struct ieee80211_device *ieee, struct iw_reques · line 2493

Quoted 9 lines
drivers/staging/rtl8192u/ieee80211/ieee80211.h +6 -0
@@ -2485,6 +2485,12 @@ extern int ieee80211_wx_set_freq(struct ieee80211_device *ieee, struct iw_reques
 extern int ieee80211_wx_get_freq(struct ieee80211_device *ieee, struct iw_request_info *a,
 			     union iwreq_data *wrqu, char *b);
 
+/* ieee80211_module.c */
+#ifdef CONFIG_IEEE80211_DEBUG
+extern int __init ieee80211_debug_init(void);
+extern void __exit ieee80211_debug_exit(void);
+#endif /* CONFIG_IEEE80211_DEBUG */
+

As it's a header file, why not always have them here, no need for the ifdef.

Quoted 6 lines

And __init and __exit don't belong in a .h function prototype.

thanks,

greg k-h

The symbol ieee80211_debug_init(void) and ieee80211_debug_exit(void) are declared as prototype in r8192U_core.c, this cause a double function prototype. It is only a comment, it not affect anything. Check it to next time.

- Joel

#4 lore raw
Quoted 47 lines · Joel Pelaez Jorge

El 11/08/14 a las 17:32, Greg Kroah-Hartman escibió:

Quoted 46 lines · Jeremiah Mahler
Quoted 30 lines

A sparse warning is generated about 'ieee80211_debug_init' and 'ieee80211_debug_exit' not being declared.

drivers/staging/rtl8192u/ieee80211/ieee80211_module.c:275:12: warning:
symbol 'ieee80211_debug_init' was not declared. Should it be static? drivers/staging/rtl8192u/ieee80211/ieee80211_module.c:297:13: warning:
symbol 'ieee80211_debug_exit' was not declared. Should it be static?

These functions are used outside of this file so using static will not work. Fix the warning by declaring the functions in the header file, ieee80211.h

Cc Greg Kroah-Hartman <[email protected]>
Cc Teodora Baluta <[email protected]>
Cc Andrea Merello <[email protected]>
Cc Joel Pelaez Jorge <[email protected]>
Cc Bob Copeland <[email protected]>
Cc Joe Perches <[email protected]>
Cc Arnd Bergmann <[email protected]>
Cc Himangi Saraogi <[email protected]>
---
 drivers/staging/rtl8192u/ieee80211/ieee80211.h | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/staging/rtl8192u/ieee80211/ieee80211.h +0 -0
index 1040bab..9cbda69 100644

drivers/staging/rtl8192u/ieee80211/ieee80211.h extern int ieee80211_wx_set_freq(struct ieee80211_device *ieee, struct iw_reques · line 2493

Quoted 9 lines
drivers/staging/rtl8192u/ieee80211/ieee80211.h +6 -0
@@ -2485,6 +2485,12 @@ extern int ieee80211_wx_set_freq(struct ieee80211_device *ieee, struct iw_reques
 extern int ieee80211_wx_get_freq(struct ieee80211_device *ieee, struct iw_request_info *a,
 			     union iwreq_data *wrqu, char *b);
 
+/* ieee80211_module.c */
+#ifdef CONFIG_IEEE80211_DEBUG
+extern int __init ieee80211_debug_init(void);
+extern void __exit ieee80211_debug_exit(void);
+#endif /* CONFIG_IEEE80211_DEBUG */
+

As it's a header file, why not always have them here, no need for the ifdef.

And __init and __exit don't belong in a .h function prototype.

Quoted 7 lines
Quoted 4 lines

thanks,

greg k-h

The symbol ieee80211_debug_init(void) and ieee80211_debug_exit(void) are declared as prototype in r8192U_core.c, this cause a double function prototype. It is only a comment, it not affect anything. Check it to next time.

- Joel

Thanks for the information Joel. While my patch does fix the sparse warning, having two duplicate function prototypes seems suboptimal as well. I will see if I can find a better way to fix this warning.

Signature · 3 lines
Jeremiah Mahler
[email protected]
http://github.com/jmahler
#5 lore raw

PATCH v3 1/1 staging: rtl8192u/ieee80211: Fix sparse ieee80211_debug_init/_exit not declared warning

A sparse warning is generated about 'ieee80211_debug_init' and 'ieee80211_debug_exit' not being declared.

drivers/staging/rtl8192u/ieee80211/ieee80211_module.c:275:12: warning:
symbol 'ieee80211_debug_init' was not declared. Should it be static? drivers/staging/rtl8192u/ieee80211/ieee80211_module.c:297:13: warning:
symbol 'ieee80211_debug_exit' was not declared. Should it be static?

These functions are used outside of this file so using static will not work. The prototypes are given in r8192U_core.c but sparse nonetheless still gives a warning. Fix the sparse warning by moving these prototypes from r8192U_core.c to ieee80211.h.

Cc Greg Kroah-Hartman <[email protected]>
Cc Joel Pelaez Jorge <[email protected]>
Cc Andrea Merello <[email protected]>
Cc "John W. Linville" <[email protected]>
Cc Joe Perches <[email protected]>
Cc Himangi Saraogi <[email protected]>
Cc Arnd Bergmann <[email protected]>
Cc Peter P Waskiewicz Jr <[email protected]>
Cc Ana Rey <[email protected]>
Cc Chaitanya Hazarey <[email protected]>
Cc Rickard Strandqvist <[email protected]>
Cc Teodora Baluta <[email protected]>

---

Notes:
Changes in v2:

- remove #ifdef CONFIG_IEEE80211_DEBUG, not needed in header.

- removed __init and __exit, not needed in header.

Changes in v3:

- remove the duplicate prototypes from r892U_core.c

- (prototypes moved from r8192U_core.c to ieee80211.h)

 drivers/staging/rtl8192u/ieee80211/ieee80211.h | 4 ++++
 drivers/staging/rtl8192u/r8192U_core.c         | 2 --
 2 files changed, 4 insertions(+), 2 deletions(-)
drivers/staging/rtl8192u/ieee80211/ieee80211.h +4 -0
index 1040bab..c118551 100644
@@ -2485,6 +2485,10 @@ extern int ieee80211_wx_set_freq(struct ieee80211_device *ieee, struct iw_reques
 extern int ieee80211_wx_get_freq(struct ieee80211_device *ieee, struct iw_request_info *a,
 			     union iwreq_data *wrqu, char *b);
 
+/* ieee80211_module.c */
+extern int ieee80211_debug_init(void);
+extern void ieee80211_debug_exit(void);
+
 //extern void ieee80211_wx_sync_scan_wq(struct ieee80211_device *ieee);
 extern void ieee80211_wx_sync_scan_wq(struct work_struct *work);
 
drivers/staging/rtl8192u/r8192U_core.c +0 -2
index 7640386..ee27bb3 100644
@@ -5277,8 +5277,6 @@ static void rtl8192_usb_disconnect(struct usb_interface *intf)
 }
 
 /* fun with the built-in ieee80211 stack... */
-extern int ieee80211_debug_init(void);
-extern void ieee80211_debug_exit(void);
 extern int ieee80211_crypto_init(void);
 extern void ieee80211_crypto_deinit(void);
 extern int ieee80211_crypto_tkip_init(void);
Signature · 1 line
2.1.0.rc1