public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] staging: rtl8192u/ieee80211: Fix sparse ieee80211_debug_init/_exit not declared warning
@ 2014-08-11 22:15 Jeremiah Mahler
  2014-08-11 22:32 ` Greg Kroah-Hartman
  0 siblings, 1 reply; 6+ messages in thread
From: Jeremiah Mahler @ 2014-08-11 22:15 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: devel, linux-kernel, Jeremiah Mahler, Teodora Baluta,
	Andrea Merello, Joel Pelaez Jorge, Bob Copeland, Joe Perches,
	Arnd Bergmann, Himangi Saraogi

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

Signed-off-by: Jeremiah Mahler <jmmahler@gmail.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Teodora Baluta <teobaluta@gmail.com>
Cc: Andrea Merello <andrea.merello@gmail.com>
Cc: Joel Pelaez Jorge <joelpelaez@gmail.com>
Cc: Bob Copeland <me@bobcopeland.com>
Cc: Joe Perches <joe@perches.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Himangi Saraogi <himangi774@gmail.com>
---
 drivers/staging/rtl8192u/ieee80211/ieee80211.h | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211.h b/drivers/staging/rtl8192u/ieee80211/ieee80211.h
index 1040bab..9cbda69 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211.h
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211.h
@@ -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);
 
-- 
2.1.0.rc1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] staging: rtl8192u/ieee80211: Fix sparse ieee80211_debug_init/_exit not declared warning
  2014-08-11 22:15 [PATCH] staging: rtl8192u/ieee80211: Fix sparse ieee80211_debug_init/_exit not declared warning Jeremiah Mahler
@ 2014-08-11 22:32 ` Greg Kroah-Hartman
  2014-08-12  1:49   ` [PATCH v2] " Jeremiah Mahler
  2014-08-12  3:11   ` [PATCH] " Joel Pelaez Jorge
  0 siblings, 2 replies; 6+ messages in thread
From: Greg Kroah-Hartman @ 2014-08-11 22:32 UTC (permalink / raw)
  To: Jeremiah Mahler
  Cc: devel, linux-kernel, Teodora Baluta, Andrea Merello,
	Joel Pelaez Jorge, Bob Copeland, Joe Perches, Arnd Bergmann,
	Himangi Saraogi

On Mon, Aug 11, 2014 at 03:15:54PM -0700, Jeremiah Mahler wrote:
> 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
> 
> Signed-off-by: Jeremiah Mahler <jmmahler@gmail.com>
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Cc: Teodora Baluta <teobaluta@gmail.com>
> Cc: Andrea Merello <andrea.merello@gmail.com>
> Cc: Joel Pelaez Jorge <joelpelaez@gmail.com>
> Cc: Bob Copeland <me@bobcopeland.com>
> Cc: Joe Perches <joe@perches.com>
> Cc: Arnd Bergmann <arnd@arndb.de>
> Cc: Himangi Saraogi <himangi774@gmail.com>
> ---
>  drivers/staging/rtl8192u/ieee80211/ieee80211.h | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211.h b/drivers/staging/rtl8192u/ieee80211/ieee80211.h
> index 1040bab..9cbda69 100644
> --- a/drivers/staging/rtl8192u/ieee80211/ieee80211.h
> +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211.h
> @@ -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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH v2] staging: rtl8192u/ieee80211: Fix sparse ieee80211_debug_init/_exit not declared warning
  2014-08-11 22:32 ` Greg Kroah-Hartman
@ 2014-08-12  1:49   ` Jeremiah Mahler
  2014-08-12  3:11   ` [PATCH] " Joel Pelaez Jorge
  1 sibling, 0 replies; 6+ messages in thread
From: Jeremiah Mahler @ 2014-08-12  1:49 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: devel, linux-kernel, Jeremiah Mahler, Teodora Baluta,
	Andrea Merello, Joel Pelaez Jorge, Bob Copeland, Joe Perches,
	Arnd Bergmann, Himangi Saraogi

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

Signed-off-by: Jeremiah Mahler <jmmahler@gmail.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Teodora Baluta <teobaluta@gmail.com>
Cc: Andrea Merello <andrea.merello@gmail.com>
Cc: Joel Pelaez Jorge <joelpelaez@gmail.com>
Cc: Bob Copeland <me@bobcopeland.com>
Cc: Joe Perches <joe@perches.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Himangi Saraogi <himangi774@gmail.com>
---

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(+)

diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211.h b/drivers/staging/rtl8192u/ieee80211/ieee80211.h
index 1040bab..c118551 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211.h
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211.h
@@ -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);
 
-- 
2.1.0.rc1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] staging: rtl8192u/ieee80211: Fix sparse ieee80211_debug_init/_exit not declared warning
  2014-08-11 22:32 ` Greg Kroah-Hartman
  2014-08-12  1:49   ` [PATCH v2] " Jeremiah Mahler
@ 2014-08-12  3:11   ` Joel Pelaez Jorge
  2014-08-12  4:17     ` Jeremiah Mahler
  1 sibling, 1 reply; 6+ messages in thread
From: Joel Pelaez Jorge @ 2014-08-12  3:11 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Jeremiah Mahler
  Cc: devel, linux-kernel, Teodora Baluta, Andrea Merello, Bob Copeland,
	Joe Perches, Arnd Bergmann, Himangi Saraogi

El 11/08/14 a las 17:32, Greg Kroah-Hartman escibió:
> On Mon, Aug 11, 2014 at 03:15:54PM -0700, Jeremiah Mahler wrote:
>> 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
>>
>> Signed-off-by: Jeremiah Mahler <jmmahler@gmail.com>
>> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
>> Cc: Teodora Baluta <teobaluta@gmail.com>
>> Cc: Andrea Merello <andrea.merello@gmail.com>
>> Cc: Joel Pelaez Jorge <joelpelaez@gmail.com>
>> Cc: Bob Copeland <me@bobcopeland.com>
>> Cc: Joe Perches <joe@perches.com>
>> Cc: Arnd Bergmann <arnd@arndb.de>
>> Cc: Himangi Saraogi <himangi774@gmail.com>
>> ---
>>  drivers/staging/rtl8192u/ieee80211/ieee80211.h | 6 ++++++
>>  1 file changed, 6 insertions(+)
>>
>> diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211.h b/drivers/staging/rtl8192u/ieee80211/ieee80211.h
>> index 1040bab..9cbda69 100644
>> --- a/drivers/staging/rtl8192u/ieee80211/ieee80211.h
>> +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211.h
>> @@ -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
> 
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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] staging: rtl8192u/ieee80211: Fix sparse ieee80211_debug_init/_exit not declared warning
  2014-08-12  3:11   ` [PATCH] " Joel Pelaez Jorge
@ 2014-08-12  4:17     ` Jeremiah Mahler
  2014-08-12  7:03       ` [PATCH v3] " Jeremiah Mahler
  0 siblings, 1 reply; 6+ messages in thread
From: Jeremiah Mahler @ 2014-08-12  4:17 UTC (permalink / raw)
  To: Joel Pelaez Jorge; +Cc: linux-kernel

On Mon, Aug 11, 2014 at 10:11:13PM -0500, Joel Pelaez Jorge wrote:
> El 11/08/14 a las 17:32, Greg Kroah-Hartman escibió:
> > On Mon, Aug 11, 2014 at 03:15:54PM -0700, Jeremiah Mahler wrote:
> >> 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
> >>
> >> Signed-off-by: Jeremiah Mahler <jmmahler@gmail.com>
> >> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> >> Cc: Teodora Baluta <teobaluta@gmail.com>
> >> Cc: Andrea Merello <andrea.merello@gmail.com>
> >> Cc: Joel Pelaez Jorge <joelpelaez@gmail.com>
> >> Cc: Bob Copeland <me@bobcopeland.com>
> >> Cc: Joe Perches <joe@perches.com>
> >> Cc: Arnd Bergmann <arnd@arndb.de>
> >> Cc: Himangi Saraogi <himangi774@gmail.com>
> >> ---
> >>  drivers/staging/rtl8192u/ieee80211/ieee80211.h | 6 ++++++
> >>  1 file changed, 6 insertions(+)
> >>
> >> diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211.h b/drivers/staging/rtl8192u/ieee80211/ieee80211.h
> >> index 1040bab..9cbda69 100644
> >> --- a/drivers/staging/rtl8192u/ieee80211/ieee80211.h
> >> +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211.h
> >> @@ -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
> > 
> 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.

-- 
Jeremiah Mahler
jmmahler@gmail.com
http://github.com/jmahler

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH v3] staging: rtl8192u/ieee80211: Fix sparse ieee80211_debug_init/_exit not declared warning
  2014-08-12  4:17     ` Jeremiah Mahler
@ 2014-08-12  7:03       ` Jeremiah Mahler
  0 siblings, 0 replies; 6+ messages in thread
From: Jeremiah Mahler @ 2014-08-12  7:03 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: devel, linux-kernel, Jeremiah Mahler, Joel Pelaez Jorge,
	Andrea Merello, John W. Linville, Joe Perches, Himangi Saraogi,
	Arnd Bergmann, Peter P Waskiewicz Jr, Ana Rey, Chaitanya Hazarey,
	Rickard Strandqvist, Teodora Baluta

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.

Signed-off-by: Jeremiah Mahler <jmmahler@gmail.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Joel Pelaez Jorge <joelpelaez@gmail.com>
Cc: Andrea Merello <andrea.merello@gmail.com>
Cc: "John W. Linville" <linville@tuxdriver.com>
Cc: Joe Perches <joe@perches.com>
Cc: Himangi Saraogi <himangi774@gmail.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
Cc: Ana Rey <anarey@gmail.com>
Cc: Chaitanya Hazarey <c@24.io>
Cc: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
Cc: Teodora Baluta <teobaluta@gmail.com>
---

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(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211.h b/drivers/staging/rtl8192u/ieee80211/ieee80211.h
index 1040bab..c118551 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211.h
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211.h
@@ -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);
 
diff --git a/drivers/staging/rtl8192u/r8192U_core.c b/drivers/staging/rtl8192u/r8192U_core.c
index 7640386..ee27bb3 100644
--- a/drivers/staging/rtl8192u/r8192U_core.c
+++ b/drivers/staging/rtl8192u/r8192U_core.c
@@ -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);
-- 
2.1.0.rc1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2014-08-12  7:05 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-11 22:15 [PATCH] staging: rtl8192u/ieee80211: Fix sparse ieee80211_debug_init/_exit not declared warning Jeremiah Mahler
2014-08-11 22:32 ` Greg Kroah-Hartman
2014-08-12  1:49   ` [PATCH v2] " Jeremiah Mahler
2014-08-12  3:11   ` [PATCH] " Joel Pelaez Jorge
2014-08-12  4:17     ` Jeremiah Mahler
2014-08-12  7:03       ` [PATCH v3] " Jeremiah Mahler

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox