Re: [PATCH] staging: rtl8192u/ieee80211: Fix sparse ieee80211_debug_init/_exit not declared warning

2014-08-11 Thread Joel Pelaez Jorge
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 
>> Cc: Greg Kroah-Hartman 
>> Cc: Teodora Baluta 
>> Cc: Andrea Merello 
>> Cc: Joel Pelaez Jorge 
>> Cc: Bob Copeland 
>> Cc: Joe Perches 
>> Cc: Arnd Bergmann 
>> Cc: Himangi Saraogi 
>> ---
>>  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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] staging: rtl8192u/ieee80211: Fix sparse ieee80211_debug_init/_exit not declared warning

2014-08-11 Thread Joel Pelaez Jorge
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 jmmah...@gmail.com
 Cc: Greg Kroah-Hartman gre...@linuxfoundation.org
 Cc: Teodora Baluta teobal...@gmail.com
 Cc: Andrea Merello andrea.mere...@gmail.com
 Cc: Joel Pelaez Jorge joelpel...@gmail.com
 Cc: Bob Copeland m...@bobcopeland.com
 Cc: Joe Perches j...@perches.com
 Cc: Arnd Bergmann a...@arndb.de
 Cc: Himangi Saraogi himangi...@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
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] Staging: rtl8192u: Remove old WIRELESS_EXT support

2014-05-23 Thread Joel Pelaez Jorge
Remove support for building against ancient WIRELESS_EXT versions,
only leaving support for the current version: 22

Signed-off-by: Joel Pelaez Jorge 
---
 drivers/staging/rtl8192u/ieee80211/ieee80211.h| 14 -
 drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c |  5 +
 drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c | 24 +--
 drivers/staging/rtl8192u/r8192U_core.c|  6 +-
 drivers/staging/rtl8192u/r8192U_wx.c  | 20 +--
 5 files changed, 4 insertions(+), 65 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211.h 
b/drivers/staging/rtl8192u/ieee80211/ieee80211.h
index cac2056..3b40b61 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211.h
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211.h
@@ -354,12 +354,10 @@ enum  _ReasonCode{
 #define ieee80211_wx_get_scan  ieee80211_wx_get_scan_rsl
 #define ieee80211_wx_set_encodeieee80211_wx_set_encode_rsl
 #define ieee80211_wx_get_encodeieee80211_wx_get_encode_rsl
-#if WIRELESS_EXT >= 18
 #define ieee80211_wx_set_mlme  ieee80211_wx_set_mlme_rsl
 #define ieee80211_wx_set_auth  ieee80211_wx_set_auth_rsl
 #define ieee80211_wx_set_encode_extieee80211_wx_set_encode_ext_rsl
 #define ieee80211_wx_get_encode_extieee80211_wx_get_encode_ext_rsl
-#endif
 
 
 typedef struct ieee_param {
@@ -392,16 +390,6 @@ typedef struct ieee_param {
 }ieee_param;
 
 
-#if WIRELESS_EXT < 17
-#define IW_QUAL_QUAL_INVALID   0x10
-#define IW_QUAL_LEVEL_INVALID  0x20
-#define IW_QUAL_NOISE_INVALID  0x40
-#define IW_QUAL_QUAL_UPDATED   0x1
-#define IW_QUAL_LEVEL_UPDATED  0x2
-#define IW_QUAL_NOISE_UPDATED  0x4
-#endif
-
-
 // linux under 2.6.9 release may not support it, so modify it for common use
 #define MSECS(t) msecs_to_jiffies(t)
 #define msleep_interruptible_rsl  msleep_interruptible
@@ -2398,7 +2386,6 @@ extern int ieee80211_wx_set_encode(struct 
ieee80211_device *ieee,
 extern int ieee80211_wx_get_encode(struct ieee80211_device *ieee,
   struct iw_request_info *info,
   union iwreq_data *wrqu, char *key);
-#if WIRELESS_EXT >= 18
 extern int ieee80211_wx_get_encode_ext(struct ieee80211_device *ieee,
struct iw_request_info *info,
union iwreq_data *wrqu, char *extra);
@@ -2411,7 +2398,6 @@ extern int ieee80211_wx_set_auth(struct ieee80211_device 
*ieee,
 extern int ieee80211_wx_set_mlme(struct ieee80211_device *ieee,
   struct iw_request_info *info,
   union iwreq_data *wrqu, char *extra);
-#endif
 extern int ieee80211_wx_set_gen_ie(struct ieee80211_device *ieee, u8 *ie, 
size_t len);
 
 /* ieee80211_softmac.c */
diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c 
b/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c
index 92707fb..89389c4 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c
@@ -950,7 +950,6 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct 
sk_buff *skb,
 
//IEEE80211_DEBUG_DATA(IEEE80211_DL_DATA, skb->data, skb->len);
 #ifdef NOT_YET
-#if WIRELESS_EXT > 15
/* Put this code here so that we avoid duplicating it in all
 * Rx paths. - Jean II */
 #ifdef IW_WIRELESS_SPY /* defined in iw_handler.h */
@@ -964,18 +963,16 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct 
sk_buff *skb,
wireless_spy_update(dev, hdr->addr2, );
}
 #endif /* IW_WIRELESS_SPY */
-#endif /* WIRELESS_EXT > 15 */
hostap_update_rx_stats(local->ap, hdr, rx_stats);
 #endif
 
-#if WIRELESS_EXT > 15
if (ieee->iw_mode == IW_MODE_MONITOR) {
ieee80211_monitor_rx(ieee, skb, rx_stats);
stats->rx_packets++;
stats->rx_bytes += skb->len;
return 1;
}
-#endif
+
if (ieee->host_decrypt) {
int idx = 0;
if (skb->len >= hdrlen + 3)
diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c 
b/drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c
index 38f124d..d43e4a7 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c
@@ -194,7 +194,7 @@ static inline char *rtl819x_translate_scan(struct 
ieee80211_device *ieee,
iwe.u.data.length = p - custom;
if (iwe.u.data.length)
start = iwe_stream_add_point(info, start, stop, , custom);
-#if (WIRELESS_EXT < 18)
+
if (ieee->wpa_enabled && network->wpa_ie_len){
char buf[MAX_WPA_IE_LEN * 2 + 30];
//  printk("WPA IE\n");
@@ -224,26 +224,6 @@ static inline char *rtl819x_translate_scan(struct 
ieee80211_device *ieee,
iwe.u.data.length = strlen(buf);
  

[PATCH] Staging: rtl8192u: Remove old WIRELESS_EXT support

2014-05-23 Thread Joel Pelaez Jorge
Remove support for building against ancient WIRELESS_EXT versions,
only leaving support for the current version: 22

Signed-off-by: Joel Pelaez Jorge joelpel...@gmail.com
---
 drivers/staging/rtl8192u/ieee80211/ieee80211.h| 14 -
 drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c |  5 +
 drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c | 24 +--
 drivers/staging/rtl8192u/r8192U_core.c|  6 +-
 drivers/staging/rtl8192u/r8192U_wx.c  | 20 +--
 5 files changed, 4 insertions(+), 65 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211.h 
b/drivers/staging/rtl8192u/ieee80211/ieee80211.h
index cac2056..3b40b61 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211.h
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211.h
@@ -354,12 +354,10 @@ enum  _ReasonCode{
 #define ieee80211_wx_get_scan  ieee80211_wx_get_scan_rsl
 #define ieee80211_wx_set_encodeieee80211_wx_set_encode_rsl
 #define ieee80211_wx_get_encodeieee80211_wx_get_encode_rsl
-#if WIRELESS_EXT = 18
 #define ieee80211_wx_set_mlme  ieee80211_wx_set_mlme_rsl
 #define ieee80211_wx_set_auth  ieee80211_wx_set_auth_rsl
 #define ieee80211_wx_set_encode_extieee80211_wx_set_encode_ext_rsl
 #define ieee80211_wx_get_encode_extieee80211_wx_get_encode_ext_rsl
-#endif
 
 
 typedef struct ieee_param {
@@ -392,16 +390,6 @@ typedef struct ieee_param {
 }ieee_param;
 
 
-#if WIRELESS_EXT  17
-#define IW_QUAL_QUAL_INVALID   0x10
-#define IW_QUAL_LEVEL_INVALID  0x20
-#define IW_QUAL_NOISE_INVALID  0x40
-#define IW_QUAL_QUAL_UPDATED   0x1
-#define IW_QUAL_LEVEL_UPDATED  0x2
-#define IW_QUAL_NOISE_UPDATED  0x4
-#endif
-
-
 // linux under 2.6.9 release may not support it, so modify it for common use
 #define MSECS(t) msecs_to_jiffies(t)
 #define msleep_interruptible_rsl  msleep_interruptible
@@ -2398,7 +2386,6 @@ extern int ieee80211_wx_set_encode(struct 
ieee80211_device *ieee,
 extern int ieee80211_wx_get_encode(struct ieee80211_device *ieee,
   struct iw_request_info *info,
   union iwreq_data *wrqu, char *key);
-#if WIRELESS_EXT = 18
 extern int ieee80211_wx_get_encode_ext(struct ieee80211_device *ieee,
struct iw_request_info *info,
union iwreq_data *wrqu, char *extra);
@@ -2411,7 +2398,6 @@ extern int ieee80211_wx_set_auth(struct ieee80211_device 
*ieee,
 extern int ieee80211_wx_set_mlme(struct ieee80211_device *ieee,
   struct iw_request_info *info,
   union iwreq_data *wrqu, char *extra);
-#endif
 extern int ieee80211_wx_set_gen_ie(struct ieee80211_device *ieee, u8 *ie, 
size_t len);
 
 /* ieee80211_softmac.c */
diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c 
b/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c
index 92707fb..89389c4 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c
@@ -950,7 +950,6 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct 
sk_buff *skb,
 
//IEEE80211_DEBUG_DATA(IEEE80211_DL_DATA, skb-data, skb-len);
 #ifdef NOT_YET
-#if WIRELESS_EXT  15
/* Put this code here so that we avoid duplicating it in all
 * Rx paths. - Jean II */
 #ifdef IW_WIRELESS_SPY /* defined in iw_handler.h */
@@ -964,18 +963,16 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct 
sk_buff *skb,
wireless_spy_update(dev, hdr-addr2, wstats);
}
 #endif /* IW_WIRELESS_SPY */
-#endif /* WIRELESS_EXT  15 */
hostap_update_rx_stats(local-ap, hdr, rx_stats);
 #endif
 
-#if WIRELESS_EXT  15
if (ieee-iw_mode == IW_MODE_MONITOR) {
ieee80211_monitor_rx(ieee, skb, rx_stats);
stats-rx_packets++;
stats-rx_bytes += skb-len;
return 1;
}
-#endif
+
if (ieee-host_decrypt) {
int idx = 0;
if (skb-len = hdrlen + 3)
diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c 
b/drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c
index 38f124d..d43e4a7 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c
@@ -194,7 +194,7 @@ static inline char *rtl819x_translate_scan(struct 
ieee80211_device *ieee,
iwe.u.data.length = p - custom;
if (iwe.u.data.length)
start = iwe_stream_add_point(info, start, stop, iwe, custom);
-#if (WIRELESS_EXT  18)
+
if (ieee-wpa_enabled  network-wpa_ie_len){
char buf[MAX_WPA_IE_LEN * 2 + 30];
//  printk(WPA IE\n);
@@ -224,26 +224,6 @@ static inline char *rtl819x_translate_scan(struct 
ieee80211_device *ieee,
iwe.u.data.length = strlen(buf);
start = iwe_stream_add_point(info, start, stop, iwe, buf

[PATCH] Staging: rtl8192u: Remove old WIRELESS_EXT support

2014-05-17 Thread Joel Pelaez Jorge
Remove support for building against ancient WIRELESS_EXT versions,
only leaving support for the current version: 22

Signed-off-by: Joel Pelaez Jorge 
---
 drivers/staging/rtl8192u/ieee80211/ieee80211.h| 14 -
 drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c |  5 +--
 drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c | 38 ++-
 drivers/staging/rtl8192u/r8192U_core.c|  6 +---
 drivers/staging/rtl8192u/r8192U_wx.c  | 20 +---
 5 files changed, 5 insertions(+), 78 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211.h 
b/drivers/staging/rtl8192u/ieee80211/ieee80211.h
index cac2056..3b40b61 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211.h
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211.h
@@ -354,12 +354,10 @@ enum  _ReasonCode{
 #define ieee80211_wx_get_scan  ieee80211_wx_get_scan_rsl
 #define ieee80211_wx_set_encodeieee80211_wx_set_encode_rsl
 #define ieee80211_wx_get_encodeieee80211_wx_get_encode_rsl
-#if WIRELESS_EXT >= 18
 #define ieee80211_wx_set_mlme  ieee80211_wx_set_mlme_rsl
 #define ieee80211_wx_set_auth  ieee80211_wx_set_auth_rsl
 #define ieee80211_wx_set_encode_extieee80211_wx_set_encode_ext_rsl
 #define ieee80211_wx_get_encode_extieee80211_wx_get_encode_ext_rsl
-#endif
 
 
 typedef struct ieee_param {
@@ -392,16 +390,6 @@ typedef struct ieee_param {
 }ieee_param;
 
 
-#if WIRELESS_EXT < 17
-#define IW_QUAL_QUAL_INVALID   0x10
-#define IW_QUAL_LEVEL_INVALID  0x20
-#define IW_QUAL_NOISE_INVALID  0x40
-#define IW_QUAL_QUAL_UPDATED   0x1
-#define IW_QUAL_LEVEL_UPDATED  0x2
-#define IW_QUAL_NOISE_UPDATED  0x4
-#endif
-
-
 // linux under 2.6.9 release may not support it, so modify it for common use
 #define MSECS(t) msecs_to_jiffies(t)
 #define msleep_interruptible_rsl  msleep_interruptible
@@ -2398,7 +2386,6 @@ extern int ieee80211_wx_set_encode(struct 
ieee80211_device *ieee,
 extern int ieee80211_wx_get_encode(struct ieee80211_device *ieee,
   struct iw_request_info *info,
   union iwreq_data *wrqu, char *key);
-#if WIRELESS_EXT >= 18
 extern int ieee80211_wx_get_encode_ext(struct ieee80211_device *ieee,
struct iw_request_info *info,
union iwreq_data *wrqu, char *extra);
@@ -2411,7 +2398,6 @@ extern int ieee80211_wx_set_auth(struct ieee80211_device 
*ieee,
 extern int ieee80211_wx_set_mlme(struct ieee80211_device *ieee,
   struct iw_request_info *info,
   union iwreq_data *wrqu, char *extra);
-#endif
 extern int ieee80211_wx_set_gen_ie(struct ieee80211_device *ieee, u8 *ie, 
size_t len);
 
 /* ieee80211_softmac.c */
diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c 
b/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c
index a98414a..b32f965 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c
@@ -950,7 +950,6 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct 
sk_buff *skb,
 
//IEEE80211_DEBUG_DATA(IEEE80211_DL_DATA, skb->data, skb->len);
 #ifdef NOT_YET
-#if WIRELESS_EXT > 15
/* Put this code here so that we avoid duplicating it in all
 * Rx paths. - Jean II */
 #ifdef IW_WIRELESS_SPY /* defined in iw_handler.h */
@@ -964,18 +963,16 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct 
sk_buff *skb,
wireless_spy_update(dev, hdr->addr2, );
}
 #endif /* IW_WIRELESS_SPY */
-#endif /* WIRELESS_EXT > 15 */
hostap_update_rx_stats(local->ap, hdr, rx_stats);
 #endif
 
-#if WIRELESS_EXT > 15
if (ieee->iw_mode == IW_MODE_MONITOR) {
ieee80211_monitor_rx(ieee, skb, rx_stats);
stats->rx_packets++;
stats->rx_bytes += skb->len;
return 1;
}
-#endif
+
if (ieee->host_decrypt) {
int idx = 0;
if (skb->len >= hdrlen + 3)
diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c 
b/drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c
index bdf67ec..b2660fe 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c
@@ -194,37 +194,7 @@ static inline char *rtl819x_translate_scan(struct 
ieee80211_device *ieee,
iwe.u.data.length = p - custom;
if (iwe.u.data.length)
start = iwe_stream_add_point(info, start, stop, , custom);
-#if (WIRELESS_EXT < 18)
-   if (ieee->wpa_enabled && network->wpa_ie_len){
-   char buf[MAX_WPA_IE_LEN * 2 + 30];
-   //  printk("WPA IE\n");
-   u8 *p = buf;
-   p += sprintf(p, "wpa_ie=");
-   for (i = 0; i < network->wpa_ie_len; i++) {
-

[PATCH] Staging: rtl8192u: Remove old WIRELESS_EXT support

2014-05-17 Thread Joel Pelaez Jorge
Remove support for building against ancient WIRELESS_EXT versions,
only leaving support for the current version: 22

Signed-off-by: Joel Pelaez Jorge joelpel...@gmail.com
---
 drivers/staging/rtl8192u/ieee80211/ieee80211.h| 14 -
 drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c |  5 +--
 drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c | 38 ++-
 drivers/staging/rtl8192u/r8192U_core.c|  6 +---
 drivers/staging/rtl8192u/r8192U_wx.c  | 20 +---
 5 files changed, 5 insertions(+), 78 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211.h 
b/drivers/staging/rtl8192u/ieee80211/ieee80211.h
index cac2056..3b40b61 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211.h
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211.h
@@ -354,12 +354,10 @@ enum  _ReasonCode{
 #define ieee80211_wx_get_scan  ieee80211_wx_get_scan_rsl
 #define ieee80211_wx_set_encodeieee80211_wx_set_encode_rsl
 #define ieee80211_wx_get_encodeieee80211_wx_get_encode_rsl
-#if WIRELESS_EXT = 18
 #define ieee80211_wx_set_mlme  ieee80211_wx_set_mlme_rsl
 #define ieee80211_wx_set_auth  ieee80211_wx_set_auth_rsl
 #define ieee80211_wx_set_encode_extieee80211_wx_set_encode_ext_rsl
 #define ieee80211_wx_get_encode_extieee80211_wx_get_encode_ext_rsl
-#endif
 
 
 typedef struct ieee_param {
@@ -392,16 +390,6 @@ typedef struct ieee_param {
 }ieee_param;
 
 
-#if WIRELESS_EXT  17
-#define IW_QUAL_QUAL_INVALID   0x10
-#define IW_QUAL_LEVEL_INVALID  0x20
-#define IW_QUAL_NOISE_INVALID  0x40
-#define IW_QUAL_QUAL_UPDATED   0x1
-#define IW_QUAL_LEVEL_UPDATED  0x2
-#define IW_QUAL_NOISE_UPDATED  0x4
-#endif
-
-
 // linux under 2.6.9 release may not support it, so modify it for common use
 #define MSECS(t) msecs_to_jiffies(t)
 #define msleep_interruptible_rsl  msleep_interruptible
@@ -2398,7 +2386,6 @@ extern int ieee80211_wx_set_encode(struct 
ieee80211_device *ieee,
 extern int ieee80211_wx_get_encode(struct ieee80211_device *ieee,
   struct iw_request_info *info,
   union iwreq_data *wrqu, char *key);
-#if WIRELESS_EXT = 18
 extern int ieee80211_wx_get_encode_ext(struct ieee80211_device *ieee,
struct iw_request_info *info,
union iwreq_data *wrqu, char *extra);
@@ -2411,7 +2398,6 @@ extern int ieee80211_wx_set_auth(struct ieee80211_device 
*ieee,
 extern int ieee80211_wx_set_mlme(struct ieee80211_device *ieee,
   struct iw_request_info *info,
   union iwreq_data *wrqu, char *extra);
-#endif
 extern int ieee80211_wx_set_gen_ie(struct ieee80211_device *ieee, u8 *ie, 
size_t len);
 
 /* ieee80211_softmac.c */
diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c 
b/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c
index a98414a..b32f965 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c
@@ -950,7 +950,6 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct 
sk_buff *skb,
 
//IEEE80211_DEBUG_DATA(IEEE80211_DL_DATA, skb-data, skb-len);
 #ifdef NOT_YET
-#if WIRELESS_EXT  15
/* Put this code here so that we avoid duplicating it in all
 * Rx paths. - Jean II */
 #ifdef IW_WIRELESS_SPY /* defined in iw_handler.h */
@@ -964,18 +963,16 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct 
sk_buff *skb,
wireless_spy_update(dev, hdr-addr2, wstats);
}
 #endif /* IW_WIRELESS_SPY */
-#endif /* WIRELESS_EXT  15 */
hostap_update_rx_stats(local-ap, hdr, rx_stats);
 #endif
 
-#if WIRELESS_EXT  15
if (ieee-iw_mode == IW_MODE_MONITOR) {
ieee80211_monitor_rx(ieee, skb, rx_stats);
stats-rx_packets++;
stats-rx_bytes += skb-len;
return 1;
}
-#endif
+
if (ieee-host_decrypt) {
int idx = 0;
if (skb-len = hdrlen + 3)
diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c 
b/drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c
index bdf67ec..b2660fe 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c
@@ -194,37 +194,7 @@ static inline char *rtl819x_translate_scan(struct 
ieee80211_device *ieee,
iwe.u.data.length = p - custom;
if (iwe.u.data.length)
start = iwe_stream_add_point(info, start, stop, iwe, custom);
-#if (WIRELESS_EXT  18)
-   if (ieee-wpa_enabled  network-wpa_ie_len){
-   char buf[MAX_WPA_IE_LEN * 2 + 30];
-   //  printk(WPA IE\n);
-   u8 *p = buf;
-   p += sprintf(p, wpa_ie=);
-   for (i = 0; i  network-wpa_ie_len; i++) {
-   p += sprintf(p, %02x, network-wpa_ie[i]);
-   }
-
-   memset(iwe, 0

[PATCH] Staging: rtl8192u: Remove old WIRELESS_EXT support

2014-05-14 Thread Joel Pelaez Jorge
Remove support for building against ancient WIRELESS_EXT versions,
only leaving support for the current version: 22
---
 drivers/staging/rtl8192u/ieee80211/ieee80211.h| 14 -
 drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c |  5 +--
 drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c | 38 ++-
 drivers/staging/rtl8192u/r8192U_core.c|  6 +---
 drivers/staging/rtl8192u/r8192U_wx.c  | 20 +---
 5 files changed, 5 insertions(+), 78 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211.h 
b/drivers/staging/rtl8192u/ieee80211/ieee80211.h
index cac2056..3b40b61 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211.h
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211.h
@@ -354,12 +354,10 @@ enum  _ReasonCode{
 #define ieee80211_wx_get_scan  ieee80211_wx_get_scan_rsl
 #define ieee80211_wx_set_encodeieee80211_wx_set_encode_rsl
 #define ieee80211_wx_get_encodeieee80211_wx_get_encode_rsl
-#if WIRELESS_EXT >= 18
 #define ieee80211_wx_set_mlme  ieee80211_wx_set_mlme_rsl
 #define ieee80211_wx_set_auth  ieee80211_wx_set_auth_rsl
 #define ieee80211_wx_set_encode_extieee80211_wx_set_encode_ext_rsl
 #define ieee80211_wx_get_encode_extieee80211_wx_get_encode_ext_rsl
-#endif
 
 
 typedef struct ieee_param {
@@ -392,16 +390,6 @@ typedef struct ieee_param {
 }ieee_param;
 
 
-#if WIRELESS_EXT < 17
-#define IW_QUAL_QUAL_INVALID   0x10
-#define IW_QUAL_LEVEL_INVALID  0x20
-#define IW_QUAL_NOISE_INVALID  0x40
-#define IW_QUAL_QUAL_UPDATED   0x1
-#define IW_QUAL_LEVEL_UPDATED  0x2
-#define IW_QUAL_NOISE_UPDATED  0x4
-#endif
-
-
 // linux under 2.6.9 release may not support it, so modify it for common use
 #define MSECS(t) msecs_to_jiffies(t)
 #define msleep_interruptible_rsl  msleep_interruptible
@@ -2398,7 +2386,6 @@ extern int ieee80211_wx_set_encode(struct 
ieee80211_device *ieee,
 extern int ieee80211_wx_get_encode(struct ieee80211_device *ieee,
   struct iw_request_info *info,
   union iwreq_data *wrqu, char *key);
-#if WIRELESS_EXT >= 18
 extern int ieee80211_wx_get_encode_ext(struct ieee80211_device *ieee,
struct iw_request_info *info,
union iwreq_data *wrqu, char *extra);
@@ -2411,7 +2398,6 @@ extern int ieee80211_wx_set_auth(struct ieee80211_device 
*ieee,
 extern int ieee80211_wx_set_mlme(struct ieee80211_device *ieee,
   struct iw_request_info *info,
   union iwreq_data *wrqu, char *extra);
-#endif
 extern int ieee80211_wx_set_gen_ie(struct ieee80211_device *ieee, u8 *ie, 
size_t len);
 
 /* ieee80211_softmac.c */
diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c 
b/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c
index a98414a..b32f965 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c
@@ -950,7 +950,6 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct 
sk_buff *skb,
 
//IEEE80211_DEBUG_DATA(IEEE80211_DL_DATA, skb->data, skb->len);
 #ifdef NOT_YET
-#if WIRELESS_EXT > 15
/* Put this code here so that we avoid duplicating it in all
 * Rx paths. - Jean II */
 #ifdef IW_WIRELESS_SPY /* defined in iw_handler.h */
@@ -964,18 +963,16 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct 
sk_buff *skb,
wireless_spy_update(dev, hdr->addr2, );
}
 #endif /* IW_WIRELESS_SPY */
-#endif /* WIRELESS_EXT > 15 */
hostap_update_rx_stats(local->ap, hdr, rx_stats);
 #endif
 
-#if WIRELESS_EXT > 15
if (ieee->iw_mode == IW_MODE_MONITOR) {
ieee80211_monitor_rx(ieee, skb, rx_stats);
stats->rx_packets++;
stats->rx_bytes += skb->len;
return 1;
}
-#endif
+
if (ieee->host_decrypt) {
int idx = 0;
if (skb->len >= hdrlen + 3)
diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c 
b/drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c
index bdf67ec..b2660fe 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c
@@ -194,37 +194,7 @@ static inline char *rtl819x_translate_scan(struct 
ieee80211_device *ieee,
iwe.u.data.length = p - custom;
if (iwe.u.data.length)
start = iwe_stream_add_point(info, start, stop, , custom);
-#if (WIRELESS_EXT < 18)
-   if (ieee->wpa_enabled && network->wpa_ie_len){
-   char buf[MAX_WPA_IE_LEN * 2 + 30];
-   //  printk("WPA IE\n");
-   u8 *p = buf;
-   p += sprintf(p, "wpa_ie=");
-   for (i = 0; i < network->wpa_ie_len; i++) {
-   p += sprintf(p, "%02x", network->wpa_ie[i]);
-   }
-
-   memset(, 0, sizeof(iwe));
-   

[PATCH] Staging: rtl8192u: Remove old WIRELESS_EXT support

2014-05-14 Thread Joel Pelaez Jorge
Remove support for building against ancient WIRELESS_EXT versions,
only leaving support for the current version: 22
---
 drivers/staging/rtl8192u/ieee80211/ieee80211.h| 14 -
 drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c |  5 +--
 drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c | 38 ++-
 drivers/staging/rtl8192u/r8192U_core.c|  6 +---
 drivers/staging/rtl8192u/r8192U_wx.c  | 20 +---
 5 files changed, 5 insertions(+), 78 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211.h 
b/drivers/staging/rtl8192u/ieee80211/ieee80211.h
index cac2056..3b40b61 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211.h
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211.h
@@ -354,12 +354,10 @@ enum  _ReasonCode{
 #define ieee80211_wx_get_scan  ieee80211_wx_get_scan_rsl
 #define ieee80211_wx_set_encodeieee80211_wx_set_encode_rsl
 #define ieee80211_wx_get_encodeieee80211_wx_get_encode_rsl
-#if WIRELESS_EXT = 18
 #define ieee80211_wx_set_mlme  ieee80211_wx_set_mlme_rsl
 #define ieee80211_wx_set_auth  ieee80211_wx_set_auth_rsl
 #define ieee80211_wx_set_encode_extieee80211_wx_set_encode_ext_rsl
 #define ieee80211_wx_get_encode_extieee80211_wx_get_encode_ext_rsl
-#endif
 
 
 typedef struct ieee_param {
@@ -392,16 +390,6 @@ typedef struct ieee_param {
 }ieee_param;
 
 
-#if WIRELESS_EXT  17
-#define IW_QUAL_QUAL_INVALID   0x10
-#define IW_QUAL_LEVEL_INVALID  0x20
-#define IW_QUAL_NOISE_INVALID  0x40
-#define IW_QUAL_QUAL_UPDATED   0x1
-#define IW_QUAL_LEVEL_UPDATED  0x2
-#define IW_QUAL_NOISE_UPDATED  0x4
-#endif
-
-
 // linux under 2.6.9 release may not support it, so modify it for common use
 #define MSECS(t) msecs_to_jiffies(t)
 #define msleep_interruptible_rsl  msleep_interruptible
@@ -2398,7 +2386,6 @@ extern int ieee80211_wx_set_encode(struct 
ieee80211_device *ieee,
 extern int ieee80211_wx_get_encode(struct ieee80211_device *ieee,
   struct iw_request_info *info,
   union iwreq_data *wrqu, char *key);
-#if WIRELESS_EXT = 18
 extern int ieee80211_wx_get_encode_ext(struct ieee80211_device *ieee,
struct iw_request_info *info,
union iwreq_data *wrqu, char *extra);
@@ -2411,7 +2398,6 @@ extern int ieee80211_wx_set_auth(struct ieee80211_device 
*ieee,
 extern int ieee80211_wx_set_mlme(struct ieee80211_device *ieee,
   struct iw_request_info *info,
   union iwreq_data *wrqu, char *extra);
-#endif
 extern int ieee80211_wx_set_gen_ie(struct ieee80211_device *ieee, u8 *ie, 
size_t len);
 
 /* ieee80211_softmac.c */
diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c 
b/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c
index a98414a..b32f965 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c
@@ -950,7 +950,6 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct 
sk_buff *skb,
 
//IEEE80211_DEBUG_DATA(IEEE80211_DL_DATA, skb-data, skb-len);
 #ifdef NOT_YET
-#if WIRELESS_EXT  15
/* Put this code here so that we avoid duplicating it in all
 * Rx paths. - Jean II */
 #ifdef IW_WIRELESS_SPY /* defined in iw_handler.h */
@@ -964,18 +963,16 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct 
sk_buff *skb,
wireless_spy_update(dev, hdr-addr2, wstats);
}
 #endif /* IW_WIRELESS_SPY */
-#endif /* WIRELESS_EXT  15 */
hostap_update_rx_stats(local-ap, hdr, rx_stats);
 #endif
 
-#if WIRELESS_EXT  15
if (ieee-iw_mode == IW_MODE_MONITOR) {
ieee80211_monitor_rx(ieee, skb, rx_stats);
stats-rx_packets++;
stats-rx_bytes += skb-len;
return 1;
}
-#endif
+
if (ieee-host_decrypt) {
int idx = 0;
if (skb-len = hdrlen + 3)
diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c 
b/drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c
index bdf67ec..b2660fe 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c
@@ -194,37 +194,7 @@ static inline char *rtl819x_translate_scan(struct 
ieee80211_device *ieee,
iwe.u.data.length = p - custom;
if (iwe.u.data.length)
start = iwe_stream_add_point(info, start, stop, iwe, custom);
-#if (WIRELESS_EXT  18)
-   if (ieee-wpa_enabled  network-wpa_ie_len){
-   char buf[MAX_WPA_IE_LEN * 2 + 30];
-   //  printk(WPA IE\n);
-   u8 *p = buf;
-   p += sprintf(p, wpa_ie=);
-   for (i = 0; i  network-wpa_ie_len; i++) {
-   p += sprintf(p, %02x, network-wpa_ie[i]);
-   }
-
-   memset(iwe, 0, sizeof(iwe));
-   iwe.cmd = IWEVCUSTOM;
-   

[PATCH] Staging: rtl8192e: Fix declaration of symbols

2014-04-19 Thread Joel Pelaez Jorge
The two declarations with issues in rtl_wx.h:

  * function: struct iw_statistics *r8192_get_wireless_stats();
  * variable: extern struct iw_handler_def r8192_wx_handlers_def;

The symbol 'r8192_get_wireless_stats' is declared as 'extern'
but it is only used in the local scope. The declaration is deleted
of rtl_wx.h, fixing the conflict with the 'extern' and 'static' scope.

The symbol 'r8192_wx_handlers_def' was fixed of some issues related
to variable declaration marked as 'extern' implicitly,
causing this sparse warning:

drivers/staging/rtl8192e/rtl8192e/rtl_wx.c:1323:24: warning: symbol
'r8192_wx_handlers_def' was not declared. Should it be static?

Resolved incluing the fixed header to rtl_wx.c

Also, isn't declared as constant variable, so it declared as such.
And delete unnecessary cast in rtl_core.c.

Signed-off-by: Joel Pelaez Jorge 
---
 drivers/staging/rtl8192e/rtl8192e/rtl_core.c | 3 +--
 drivers/staging/rtl8192e/rtl8192e/rtl_wx.c   | 3 ++-
 drivers/staging/rtl8192e/rtl8192e/rtl_wx.h   | 3 +--
 3 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c 
b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
index c01abc2..fa087b6 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
@@ -2926,8 +2926,7 @@ static int rtl8192_pci_probe(struct pci_dev *pdev,
 
dev->netdev_ops = _netdev_ops;
 
-   dev->wireless_handlers = (struct iw_handler_def *)
-_wx_handlers_def;
+   dev->wireless_handlers = _wx_handlers_def;
dev->ethtool_ops = _ethtool_ops;
 
dev->type = ARPHRD_ETHER;
diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c 
b/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c
index 498995d..7d8fcde 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c
@@ -19,6 +19,7 @@
 
 #include 
 #include "rtl_core.h"
+#include "rtl_wx.h"
 
 #define RATE_COUNT 12
 static u32 rtl8192_rates[] = {
@@ -1320,7 +1321,7 @@ static struct iw_statistics 
*r8192_get_wireless_stats(struct net_device *dev)
return wstats;
 }
 
-struct iw_handler_def  r8192_wx_handlers_def = {
+const struct iw_handler_def r8192_wx_handlers_def = {
.standard = r8192_wx_handlers,
.num_standard = ARRAY_SIZE(r8192_wx_handlers),
.private = r8192_private_handler,
diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_wx.h 
b/drivers/staging/rtl8192e/rtl8192e/rtl_wx.h
index 6a51a25..5839851 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_wx.h
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_wx.h
@@ -24,8 +24,7 @@ struct net_device;
 struct iw_handler_def;
 struct iw_statistics;
 
-extern struct iw_handler_def r8192_wx_handlers_def;
-struct iw_statistics *r8192_get_wireless_stats(struct net_device *dev);
+extern const struct iw_handler_def r8192_wx_handlers_def;
 u16 rtl8192_11n_user_show_rates(struct net_device *dev);
 
 #endif
-- 
1.9.2

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


[PATCH] Staging: rtl8192e: Fix declaration of symbols

2014-04-19 Thread Joel Pelaez Jorge
The two declarations with issues in rtl_wx.h:

  * function: struct iw_statistics *r8192_get_wireless_stats();
  * variable: extern struct iw_handler_def r8192_wx_handlers_def;

The symbol 'r8192_get_wireless_stats' is declared as 'extern'
but it is only used in the local scope. The declaration is deleted
of rtl_wx.h, fixing the conflict with the 'extern' and 'static' scope.

The symbol 'r8192_wx_handlers_def' was fixed of some issues related
to variable declaration marked as 'extern' implicitly,
causing this sparse warning:

drivers/staging/rtl8192e/rtl8192e/rtl_wx.c:1323:24: warning: symbol
'r8192_wx_handlers_def' was not declared. Should it be static?

Resolved incluing the fixed header to rtl_wx.c

Also, isn't declared as constant variable, so it declared as such.
And delete unnecessary cast in rtl_core.c.

Signed-off-by: Joel Pelaez Jorge joelpel...@gmail.com
---
 drivers/staging/rtl8192e/rtl8192e/rtl_core.c | 3 +--
 drivers/staging/rtl8192e/rtl8192e/rtl_wx.c   | 3 ++-
 drivers/staging/rtl8192e/rtl8192e/rtl_wx.h   | 3 +--
 3 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c 
b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
index c01abc2..fa087b6 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
@@ -2926,8 +2926,7 @@ static int rtl8192_pci_probe(struct pci_dev *pdev,
 
dev-netdev_ops = rtl8192_netdev_ops;
 
-   dev-wireless_handlers = (struct iw_handler_def *)
-r8192_wx_handlers_def;
+   dev-wireless_handlers = r8192_wx_handlers_def;
dev-ethtool_ops = rtl819x_ethtool_ops;
 
dev-type = ARPHRD_ETHER;
diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c 
b/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c
index 498995d..7d8fcde 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c
@@ -19,6 +19,7 @@
 
 #include linux/string.h
 #include rtl_core.h
+#include rtl_wx.h
 
 #define RATE_COUNT 12
 static u32 rtl8192_rates[] = {
@@ -1320,7 +1321,7 @@ static struct iw_statistics 
*r8192_get_wireless_stats(struct net_device *dev)
return wstats;
 }
 
-struct iw_handler_def  r8192_wx_handlers_def = {
+const struct iw_handler_def r8192_wx_handlers_def = {
.standard = r8192_wx_handlers,
.num_standard = ARRAY_SIZE(r8192_wx_handlers),
.private = r8192_private_handler,
diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_wx.h 
b/drivers/staging/rtl8192e/rtl8192e/rtl_wx.h
index 6a51a25..5839851 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_wx.h
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_wx.h
@@ -24,8 +24,7 @@ struct net_device;
 struct iw_handler_def;
 struct iw_statistics;
 
-extern struct iw_handler_def r8192_wx_handlers_def;
-struct iw_statistics *r8192_get_wireless_stats(struct net_device *dev);
+extern const struct iw_handler_def r8192_wx_handlers_def;
 u16 rtl8192_11n_user_show_rates(struct net_device *dev);
 
 #endif
-- 
1.9.2

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


[PATCH v3] Staging: rtl8192e: Fix declaration of symbols

2014-04-06 Thread Joel Pelaez Jorge
The two declarations with issues in rtl_wx.h:

  * function: struct iw_statistics *r8192_get_wireless_stats();
  * variable: extern struct iw_handler_def r8192_wx_handlers_def;

The symbol 'r8192_get_wireless_stats' is declared as 'extern'
but it is only used in the local scope. The declaration is deleted
of rtl_wx.h, fixing the conflict with the 'extern' and 'static' scope.

The symbol 'r8192_wx_handlers_def' was fixed of some issues related
to variable declaration marked as 'extern' implicitly,
causing this sparse warning:

drivers/staging/rtl8192e/rtl8192e/rtl_wx.c:1323:24: warning: symbol
'r8192_wx_handlers_def' was not declared. Should it be static?

Resolved incluing the fixed header to rtl_wx.c

Also, isn't declared as constant variable, so it declared as such.
And delete unnecessary cast in rtl_core.c.

Signed-off-by: Joel Pelaez Jorge 
---
 drivers/staging/rtl8192e/rtl8192e/rtl_core.c | 3 +--
 drivers/staging/rtl8192e/rtl8192e/rtl_wx.c   | 3 ++-
 drivers/staging/rtl8192e/rtl8192e/rtl_wx.h   | 3 +--
 3 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
index c01abc2..fa087b6 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
@@ -2926,8 +2926,7 @@ static int rtl8192_pci_probe(struct pci_dev *pdev,

dev->netdev_ops = _netdev_ops;

-   dev->wireless_handlers = (struct iw_handler_def *)
-_wx_handlers_def;
+   dev->wireless_handlers = _wx_handlers_def;
dev->ethtool_ops = _ethtool_ops;

dev->type = ARPHRD_ETHER;
diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c
b/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c
index 498995d..7d8fcde 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c
@@ -19,6 +19,7 @@

 #include 
 #include "rtl_core.h"
+#include "rtl_wx.h"

 #define RATE_COUNT 12
 static u32 rtl8192_rates[] = {
@@ -1320,7 +1321,7 @@ static struct iw_statistics
*r8192_get_wireless_stats(struct net_device *dev)
return wstats;
 }

-struct iw_handler_def  r8192_wx_handlers_def = {
+const struct iw_handler_def r8192_wx_handlers_def = {
.standard = r8192_wx_handlers,
.num_standard = ARRAY_SIZE(r8192_wx_handlers),
.private = r8192_private_handler,
diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_wx.h
b/drivers/staging/rtl8192e/rtl8192e/rtl_wx.h
index 6a51a25..5839851 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_wx.h
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_wx.h
@@ -24,8 +24,7 @@ struct net_device;
 struct iw_handler_def;
 struct iw_statistics;

-extern struct iw_handler_def r8192_wx_handlers_def;
-struct iw_statistics *r8192_get_wireless_stats(struct net_device *dev);
+extern const struct iw_handler_def r8192_wx_handlers_def;
 u16 rtl8192_11n_user_show_rates(struct net_device *dev);

 #endif
-- 
1.9.1


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


[PATCH 2/2] Staging: rtl8192e: Fix sparse warning

2014-04-06 Thread Joel Pelaez Jorge
Include the header 'rtl_wx.h' to 'rtl_wx.c'

'rtl_wx.h' has the declarations used for some source files of
the driver. It has:

extern struct iw_handler_def r8192_wx_handlers_def;

That fix the problem:

drivers/staging/rtl8192e/rtl8192e/rtl_wx.c:1323:24: warning:
symbol 'r8192_wx_handlers_def' was not declared. Should it be static?

Signed-off-by: Joel Pelaez Jorge 
---
 drivers/staging/rtl8192e/rtl8192e/rtl_wx.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c
b/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c
index 498995d..2de95f3 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c
@@ -19,6 +19,7 @@

 #include 
 #include "rtl_core.h"
+#include "rtl_wx.h"

 #define RATE_COUNT 12
 static u32 rtl8192_rates[] = {
-- 
1.9.1


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


[PATCH 1/2] Staging: rtl8192e: Remove bad 'extern' declaration

2014-04-06 Thread Joel Pelaez Jorge
Remove extern declaration to a static function:
iw_statistics *r8192_get_wireless_stats(struct net_device *dev);

Signed-off-by: Joel Pelaez Jorge 
---
 drivers/staging/rtl8192e/rtl8192e/rtl_wx.h | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_wx.h
b/drivers/staging/rtl8192e/rtl8192e/rtl_wx.h
index 6a51a25..6437664 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_wx.h
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_wx.h
@@ -25,7 +25,6 @@ struct iw_handler_def;
 struct iw_statistics;

 extern struct iw_handler_def r8192_wx_handlers_def;
-struct iw_statistics *r8192_get_wireless_stats(struct net_device *dev);
 u16 rtl8192_11n_user_show_rates(struct net_device *dev);

 #endif
-- 
1.9.1


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


[PATCH 0/3] Staging: rtl8192e: Fix code issues

2014-04-06 Thread Joel Pelaez Jorge
In the kernel driver: rtl8192e, exists some problems related
to source check, using the tool sparse, but for fix it, is necessary
remove a bad declaration that keep off the patch.

Because it is resolved before apply the "main" patch.

Joel Pelaez Jorge (2):
  Staging: rtl8192e: Remove bad 'extern' declaration
  Staging: rtl8192e: Fix sparse warning

 drivers/staging/rtl8192e/rtl8192e/rtl_wx.c |1 +
 drivers/staging/rtl8192e/rtl8192e/rtl_wx.h |1 -
 2 files changed, 1 insertion(+), 1 deletion(-)

--
1.9.1

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


Re: [PATCH v2] Staging: rtl8192e: Fix sparse warning

2014-04-06 Thread Joel Pelaez Jorge
El 06/04/14 15:26, Greg Kroah-Hartman escribió:
> On Sun, Apr 06, 2014 at 02:12:44PM -0500, Joel Pelaez Jorge wrote:
>> El 06/04/14 14:01, Greg Kroah-Hartman escribió:
>>> On Sun, Apr 06, 2014 at 01:43:38PM -0500, Joel Pelaez Jorge wrote:
>>>> Fix a sparse warning, non static symbol is no declared as such.
>>>> And fix a conflict with static function declared extern to include
>>>> rtl_wx.h header.
>>>>
>>>> drivers/staging/rtl8192e/rtl8192e/rtl_wx.c:1323:24: warning:
>>>> symbol 'r8192_wx_handlers_def' was not declared. Should it be static?
>>>>
>>>> Signed-off-by: Joel Pelaez Jorge 
>>>> ---
>>>> drivers/staging/rtl8192e/rtl8192e/rtl_wx.c |3 ++-
>>>> 1 file changed, 2 insertions(+), 1 deletion(-)
>>>>
>>>> diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c
>>>> b/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c
>>>> index 498995d..f17584d 100644
>>>> --- a/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c
>>>> +++ b/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c
>>>> @@ -19,6 +19,7 @@
>>>>
>>>> #include 
>>>> #include "rtl_core.h"
>>>> +#include "rtl_wx.h"
>>>
>>> Why is this needed?
>>>
>>>>
>>>> #define RATE_COUNT 12
>>>> static u32 rtl8192_rates[] = {
>>>> @@ -1293,7 +1294,7 @@ static iw_handler r8192_private_handler[] = {
>>>>(iw_handler)r8192_wx_get_PromiscuousMode,
>>>> };
>>>>
>>>> -static struct iw_statistics *r8192_get_wireless_stats(struct net_device
>>>> *dev)
>>>> +struct iw_statistics *r8192_get_wireless_stats(struct net_device *dev)
>>>
>>> Why make this global?  This doesn't have anything to do with the warning
>>> you are working on as described above.
>>>
>>> totally confused,
>>>
>>> greg k-h
>>>
>>   >
>> In the "rtl_wx.h" header declare extern 'r8192_wx_handlers_def'
>> but r8192_get_wireless_stats too.
> 
> I don't understand what this sentance means :(
> 
>> Because r8192_get_wireless_stats is used by rtl_core.h if WIRELESS_EXT
>> is more that 12 but less that 17.
> 
> Will that value ever change?
> 
> thanks,
> 
> greg k-h
> 
The file: 'rtl_wx.h' is a header that defines some symbols uses
externally by 'rtl_core.c', it declare:

extern struct iw_handler_def r8192_wx_handlers_def;
struct iw_statistics *r8192_get_wireless_stats(struct net_device *dev);

If this header is included in rtl_wx.c, fix the sparse warning, but
cause conflict with the function declaration, because in 'rtl_wx.c'
r8192_get_wireless_stats is defined as 'static'.

In the header is defined as 'extern' because is called by rtl_core.c
if the WIRELESS_EXT certain values.

By the way, WIRELESS_EXT is a define constant that indicate the
wireless extension version supported by the kernel it only up.
The better solution is remove the code that called the function, remove
the declaration and only keep 'r8192_wx_handlers_def'.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v2] Staging: rtl8192e: Fix sparse warning

2014-04-06 Thread Joel Pelaez Jorge

El 06/04/14 14:01, Greg Kroah-Hartman escribió:

On Sun, Apr 06, 2014 at 01:43:38PM -0500, Joel Pelaez Jorge wrote:

Fix a sparse warning, non static symbol is no declared as such.
And fix a conflict with static function declared extern to include
rtl_wx.h header.

drivers/staging/rtl8192e/rtl8192e/rtl_wx.c:1323:24: warning:
symbol 'r8192_wx_handlers_def' was not declared. Should it be static?

Signed-off-by: Joel Pelaez Jorge 
---
   drivers/staging/rtl8192e/rtl8192e/rtl_wx.c |3 ++-
   1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c
b/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c
index 498995d..f17584d 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c
@@ -19,6 +19,7 @@

   #include 
   #include "rtl_core.h"
+#include "rtl_wx.h"


Why is this needed?



   #define RATE_COUNT 12
   static u32 rtl8192_rates[] = {
@@ -1293,7 +1294,7 @@ static iw_handler r8192_private_handler[] = {
(iw_handler)r8192_wx_get_PromiscuousMode,
   };

-static struct iw_statistics *r8192_get_wireless_stats(struct net_device
*dev)
+struct iw_statistics *r8192_get_wireless_stats(struct net_device *dev)


Why make this global?  This doesn't have anything to do with the warning
you are working on as described above.

totally confused,

greg k-h


>
In the "rtl_wx.h" header declare extern 'r8192_wx_handlers_def'
but r8192_get_wireless_stats too. Because r8192_get_wireless_stats
is used by rtl_core.h if WIRELESS_EXT is more that 12 but less that 17.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v2] Staging: rtl8192e: Fix sparse warning

2014-04-06 Thread Joel Pelaez Jorge

El 06/04/14 13:49, Joe Perches escribió:

On Sun, 2014-04-06 at 13:43 -0500, Joel Pelaez Jorge wrote:

Fix a sparse warning, non static symbol is no declared as such.
And fix a conflict with static function declared extern to include
rtl_wx.h header.

drivers/staging/rtl8192e/rtl8192e/rtl_wx.c:1323:24: warning:
symbol 'r8192_wx_handlers_def' was not declared. Should it be static?

Signed-off-by: Joel Pelaez Jorge 
---
   drivers/staging/rtl8192e/rtl8192e/rtl_wx.c |3 ++-
   1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c
b/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c
index 498995d..f17584d 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c
@@ -19,6 +19,7 @@

   #include 
   #include "rtl_core.h"
+#include "rtl_wx.h"

   #define RATE_COUNT 12
   static u32 rtl8192_rates[] = {
@@ -1293,7 +1294,7 @@ static iw_handler r8192_private_handler[] = {
(iw_handler)r8192_wx_get_PromiscuousMode,
   };

-static struct iw_statistics *r8192_get_wireless_stats(struct net_device
*dev)
+struct iw_statistics *r8192_get_wireless_stats(struct net_device *dev)
   {
struct r8192_priv *priv = rtllib_priv(dev);
struct rtllib_device *ieee = priv->rtllib;


As far as I can tell, there's no reason this should
be declared in the .h file and it should stay static
and not be exposed at all.



In the source "rtl_core.c" is possible to use the symbol
r8192_get_wireless_stats, if WIRELESS_EXT has specifics values.

Although this scenario is unlikely to happen, is better prepare
this code for it.

Also, a better way will be delete 'extern' reference to symbol
in header file and source file.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH v2] Staging: rtl8192e: Fix sparse warning

2014-04-06 Thread Joel Pelaez Jorge

Fix a sparse warning, non static symbol is no declared as such.
And fix a conflict with static function declared extern to include
rtl_wx.h header.

drivers/staging/rtl8192e/rtl8192e/rtl_wx.c:1323:24: warning:
symbol 'r8192_wx_handlers_def' was not declared. Should it be static?

Signed-off-by: Joel Pelaez Jorge 
---
 drivers/staging/rtl8192e/rtl8192e/rtl_wx.c |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c 
b/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c

index 498995d..f17584d 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c
@@ -19,6 +19,7 @@

 #include 
 #include "rtl_core.h"
+#include "rtl_wx.h"

 #define RATE_COUNT 12
 static u32 rtl8192_rates[] = {
@@ -1293,7 +1294,7 @@ static iw_handler r8192_private_handler[] = {
(iw_handler)r8192_wx_get_PromiscuousMode,
 };

-static struct iw_statistics *r8192_get_wireless_stats(struct net_device 
*dev)

+struct iw_statistics *r8192_get_wireless_stats(struct net_device *dev)
 {
struct r8192_priv *priv = rtllib_priv(dev);
struct rtllib_device *ieee = priv->rtllib;
--
1.7.10.4

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


[PATCH] Staging: rtl8192e: Fix sparse warning

2014-04-06 Thread Joel Pelaez Jorge

drivers/staging/rtl8192e/rtl8192e/rtl_wx.c:1323:24: warning:
symbol 'r8192_wx_handlers_def' was not declared. Should it be static

Signed-off-by: Joel Pelaez Jorge 
---
 drivers/staging/rtl8192e/rtl8192e/rtl_wx.c |2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c 
b/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c

index 498995d..5baa699 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c
@@ -20,6 +20,8 @@
 #include 
 #include "rtl_core.h"

+extern struct iw_handler_def r8192_wx_handlers_def;
+
 #define RATE_COUNT 12
 static u32 rtl8192_rates[] = {
100, 200, 550, 1100, 600, 900, 1200,
--
1.7.10.4
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] Staging: rtl8192e: Fix sparse warning

2014-04-06 Thread Joel Pelaez Jorge

drivers/staging/rtl8192e/rtl8192e/rtl_wx.c:1323:24: warning:
symbol 'r8192_wx_handlers_def' was not declared. Should it be static

Signed-off-by: Joel Pelaez Jorge joelpel...@gmail.com
---
 drivers/staging/rtl8192e/rtl8192e/rtl_wx.c |2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c 
b/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c

index 498995d..5baa699 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c
@@ -20,6 +20,8 @@
 #include linux/string.h
 #include rtl_core.h

+extern struct iw_handler_def r8192_wx_handlers_def;
+
 #define RATE_COUNT 12
 static u32 rtl8192_rates[] = {
100, 200, 550, 1100, 600, 900, 1200,
--
1.7.10.4
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH v2] Staging: rtl8192e: Fix sparse warning

2014-04-06 Thread Joel Pelaez Jorge

Fix a sparse warning, non static symbol is no declared as such.
And fix a conflict with static function declared extern to include
rtl_wx.h header.

drivers/staging/rtl8192e/rtl8192e/rtl_wx.c:1323:24: warning:
symbol 'r8192_wx_handlers_def' was not declared. Should it be static?

Signed-off-by: Joel Pelaez Jorge joelpel...@gmail.com
---
 drivers/staging/rtl8192e/rtl8192e/rtl_wx.c |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c 
b/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c

index 498995d..f17584d 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c
@@ -19,6 +19,7 @@

 #include linux/string.h
 #include rtl_core.h
+#include rtl_wx.h

 #define RATE_COUNT 12
 static u32 rtl8192_rates[] = {
@@ -1293,7 +1294,7 @@ static iw_handler r8192_private_handler[] = {
(iw_handler)r8192_wx_get_PromiscuousMode,
 };

-static struct iw_statistics *r8192_get_wireless_stats(struct net_device 
*dev)

+struct iw_statistics *r8192_get_wireless_stats(struct net_device *dev)
 {
struct r8192_priv *priv = rtllib_priv(dev);
struct rtllib_device *ieee = priv-rtllib;
--
1.7.10.4

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


Re: [PATCH v2] Staging: rtl8192e: Fix sparse warning

2014-04-06 Thread Joel Pelaez Jorge

El 06/04/14 13:49, Joe Perches escribió:

On Sun, 2014-04-06 at 13:43 -0500, Joel Pelaez Jorge wrote:

Fix a sparse warning, non static symbol is no declared as such.
And fix a conflict with static function declared extern to include
rtl_wx.h header.

drivers/staging/rtl8192e/rtl8192e/rtl_wx.c:1323:24: warning:
symbol 'r8192_wx_handlers_def' was not declared. Should it be static?

Signed-off-by: Joel Pelaez Jorge joelpel...@gmail.com
---
   drivers/staging/rtl8192e/rtl8192e/rtl_wx.c |3 ++-
   1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c
b/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c
index 498995d..f17584d 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c
@@ -19,6 +19,7 @@

   #include linux/string.h
   #include rtl_core.h
+#include rtl_wx.h

   #define RATE_COUNT 12
   static u32 rtl8192_rates[] = {
@@ -1293,7 +1294,7 @@ static iw_handler r8192_private_handler[] = {
(iw_handler)r8192_wx_get_PromiscuousMode,
   };

-static struct iw_statistics *r8192_get_wireless_stats(struct net_device
*dev)
+struct iw_statistics *r8192_get_wireless_stats(struct net_device *dev)
   {
struct r8192_priv *priv = rtllib_priv(dev);
struct rtllib_device *ieee = priv-rtllib;


As far as I can tell, there's no reason this should
be declared in the .h file and it should stay static
and not be exposed at all.



In the source rtl_core.c is possible to use the symbol
r8192_get_wireless_stats, if WIRELESS_EXT has specifics values.

Although this scenario is unlikely to happen, is better prepare
this code for it.

Also, a better way will be delete 'extern' reference to symbol
in header file and source file.
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v2] Staging: rtl8192e: Fix sparse warning

2014-04-06 Thread Joel Pelaez Jorge

El 06/04/14 14:01, Greg Kroah-Hartman escribió:

On Sun, Apr 06, 2014 at 01:43:38PM -0500, Joel Pelaez Jorge wrote:

Fix a sparse warning, non static symbol is no declared as such.
And fix a conflict with static function declared extern to include
rtl_wx.h header.

drivers/staging/rtl8192e/rtl8192e/rtl_wx.c:1323:24: warning:
symbol 'r8192_wx_handlers_def' was not declared. Should it be static?

Signed-off-by: Joel Pelaez Jorge joelpel...@gmail.com
---
   drivers/staging/rtl8192e/rtl8192e/rtl_wx.c |3 ++-
   1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c
b/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c
index 498995d..f17584d 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c
@@ -19,6 +19,7 @@

   #include linux/string.h
   #include rtl_core.h
+#include rtl_wx.h


Why is this needed?



   #define RATE_COUNT 12
   static u32 rtl8192_rates[] = {
@@ -1293,7 +1294,7 @@ static iw_handler r8192_private_handler[] = {
(iw_handler)r8192_wx_get_PromiscuousMode,
   };

-static struct iw_statistics *r8192_get_wireless_stats(struct net_device
*dev)
+struct iw_statistics *r8192_get_wireless_stats(struct net_device *dev)


Why make this global?  This doesn't have anything to do with the warning
you are working on as described above.

totally confused,

greg k-h



In the rtl_wx.h header declare extern 'r8192_wx_handlers_def'
but r8192_get_wireless_stats too. Because r8192_get_wireless_stats
is used by rtl_core.h if WIRELESS_EXT is more that 12 but less that 17.
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v2] Staging: rtl8192e: Fix sparse warning

2014-04-06 Thread Joel Pelaez Jorge
El 06/04/14 15:26, Greg Kroah-Hartman escribió:
 On Sun, Apr 06, 2014 at 02:12:44PM -0500, Joel Pelaez Jorge wrote:
 El 06/04/14 14:01, Greg Kroah-Hartman escribió:
 On Sun, Apr 06, 2014 at 01:43:38PM -0500, Joel Pelaez Jorge wrote:
 Fix a sparse warning, non static symbol is no declared as such.
 And fix a conflict with static function declared extern to include
 rtl_wx.h header.

 drivers/staging/rtl8192e/rtl8192e/rtl_wx.c:1323:24: warning:
 symbol 'r8192_wx_handlers_def' was not declared. Should it be static?

 Signed-off-by: Joel Pelaez Jorge joelpel...@gmail.com
 ---
 drivers/staging/rtl8192e/rtl8192e/rtl_wx.c |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

 diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c
 b/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c
 index 498995d..f17584d 100644
 --- a/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c
 +++ b/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c
 @@ -19,6 +19,7 @@

 #include linux/string.h
 #include rtl_core.h
 +#include rtl_wx.h

 Why is this needed?


 #define RATE_COUNT 12
 static u32 rtl8192_rates[] = {
 @@ -1293,7 +1294,7 @@ static iw_handler r8192_private_handler[] = {
(iw_handler)r8192_wx_get_PromiscuousMode,
 };

 -static struct iw_statistics *r8192_get_wireless_stats(struct net_device
 *dev)
 +struct iw_statistics *r8192_get_wireless_stats(struct net_device *dev)

 Why make this global?  This doesn't have anything to do with the warning
 you are working on as described above.

 totally confused,

 greg k-h

   
 In the rtl_wx.h header declare extern 'r8192_wx_handlers_def'
 but r8192_get_wireless_stats too.
 
 I don't understand what this sentance means :(
 
 Because r8192_get_wireless_stats is used by rtl_core.h if WIRELESS_EXT
 is more that 12 but less that 17.
 
 Will that value ever change?
 
 thanks,
 
 greg k-h
 
The file: 'rtl_wx.h' is a header that defines some symbols uses
externally by 'rtl_core.c', it declare:

extern struct iw_handler_def r8192_wx_handlers_def;
struct iw_statistics *r8192_get_wireless_stats(struct net_device *dev);

If this header is included in rtl_wx.c, fix the sparse warning, but
cause conflict with the function declaration, because in 'rtl_wx.c'
r8192_get_wireless_stats is defined as 'static'.

In the header is defined as 'extern' because is called by rtl_core.c
if the WIRELESS_EXT certain values.

By the way, WIRELESS_EXT is a define constant that indicate the
wireless extension version supported by the kernel it only up.
The better solution is remove the code that called the function, remove
the declaration and only keep 'r8192_wx_handlers_def'.
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 0/3] Staging: rtl8192e: Fix code issues

2014-04-06 Thread Joel Pelaez Jorge
In the kernel driver: rtl8192e, exists some problems related
to source check, using the tool sparse, but for fix it, is necessary
remove a bad declaration that keep off the patch.

Because it is resolved before apply the main patch.

Joel Pelaez Jorge (2):
  Staging: rtl8192e: Remove bad 'extern' declaration
  Staging: rtl8192e: Fix sparse warning

 drivers/staging/rtl8192e/rtl8192e/rtl_wx.c |1 +
 drivers/staging/rtl8192e/rtl8192e/rtl_wx.h |1 -
 2 files changed, 1 insertion(+), 1 deletion(-)

--
1.9.1

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


[PATCH 1/2] Staging: rtl8192e: Remove bad 'extern' declaration

2014-04-06 Thread Joel Pelaez Jorge
Remove extern declaration to a static function:
iw_statistics *r8192_get_wireless_stats(struct net_device *dev);

Signed-off-by: Joel Pelaez Jorge joelpel...@gmail.com
---
 drivers/staging/rtl8192e/rtl8192e/rtl_wx.h | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_wx.h
b/drivers/staging/rtl8192e/rtl8192e/rtl_wx.h
index 6a51a25..6437664 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_wx.h
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_wx.h
@@ -25,7 +25,6 @@ struct iw_handler_def;
 struct iw_statistics;

 extern struct iw_handler_def r8192_wx_handlers_def;
-struct iw_statistics *r8192_get_wireless_stats(struct net_device *dev);
 u16 rtl8192_11n_user_show_rates(struct net_device *dev);

 #endif
-- 
1.9.1


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


[PATCH 2/2] Staging: rtl8192e: Fix sparse warning

2014-04-06 Thread Joel Pelaez Jorge
Include the header 'rtl_wx.h' to 'rtl_wx.c'

'rtl_wx.h' has the declarations used for some source files of
the driver. It has:

extern struct iw_handler_def r8192_wx_handlers_def;

That fix the problem:

drivers/staging/rtl8192e/rtl8192e/rtl_wx.c:1323:24: warning:
symbol 'r8192_wx_handlers_def' was not declared. Should it be static?

Signed-off-by: Joel Pelaez Jorge joelpel...@gmail.com
---
 drivers/staging/rtl8192e/rtl8192e/rtl_wx.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c
b/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c
index 498995d..2de95f3 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c
@@ -19,6 +19,7 @@

 #include linux/string.h
 #include rtl_core.h
+#include rtl_wx.h

 #define RATE_COUNT 12
 static u32 rtl8192_rates[] = {
-- 
1.9.1


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


[PATCH v3] Staging: rtl8192e: Fix declaration of symbols

2014-04-06 Thread Joel Pelaez Jorge
The two declarations with issues in rtl_wx.h:

  * function: struct iw_statistics *r8192_get_wireless_stats();
  * variable: extern struct iw_handler_def r8192_wx_handlers_def;

The symbol 'r8192_get_wireless_stats' is declared as 'extern'
but it is only used in the local scope. The declaration is deleted
of rtl_wx.h, fixing the conflict with the 'extern' and 'static' scope.

The symbol 'r8192_wx_handlers_def' was fixed of some issues related
to variable declaration marked as 'extern' implicitly,
causing this sparse warning:

drivers/staging/rtl8192e/rtl8192e/rtl_wx.c:1323:24: warning: symbol
'r8192_wx_handlers_def' was not declared. Should it be static?

Resolved incluing the fixed header to rtl_wx.c

Also, isn't declared as constant variable, so it declared as such.
And delete unnecessary cast in rtl_core.c.

Signed-off-by: Joel Pelaez Jorge joelpel...@gmail.com
---
 drivers/staging/rtl8192e/rtl8192e/rtl_core.c | 3 +--
 drivers/staging/rtl8192e/rtl8192e/rtl_wx.c   | 3 ++-
 drivers/staging/rtl8192e/rtl8192e/rtl_wx.h   | 3 +--
 3 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
index c01abc2..fa087b6 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
@@ -2926,8 +2926,7 @@ static int rtl8192_pci_probe(struct pci_dev *pdev,

dev-netdev_ops = rtl8192_netdev_ops;

-   dev-wireless_handlers = (struct iw_handler_def *)
-r8192_wx_handlers_def;
+   dev-wireless_handlers = r8192_wx_handlers_def;
dev-ethtool_ops = rtl819x_ethtool_ops;

dev-type = ARPHRD_ETHER;
diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c
b/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c
index 498995d..7d8fcde 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c
@@ -19,6 +19,7 @@

 #include linux/string.h
 #include rtl_core.h
+#include rtl_wx.h

 #define RATE_COUNT 12
 static u32 rtl8192_rates[] = {
@@ -1320,7 +1321,7 @@ static struct iw_statistics
*r8192_get_wireless_stats(struct net_device *dev)
return wstats;
 }

-struct iw_handler_def  r8192_wx_handlers_def = {
+const struct iw_handler_def r8192_wx_handlers_def = {
.standard = r8192_wx_handlers,
.num_standard = ARRAY_SIZE(r8192_wx_handlers),
.private = r8192_private_handler,
diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_wx.h
b/drivers/staging/rtl8192e/rtl8192e/rtl_wx.h
index 6a51a25..5839851 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_wx.h
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_wx.h
@@ -24,8 +24,7 @@ struct net_device;
 struct iw_handler_def;
 struct iw_statistics;

-extern struct iw_handler_def r8192_wx_handlers_def;
-struct iw_statistics *r8192_get_wireless_stats(struct net_device *dev);
+extern const struct iw_handler_def r8192_wx_handlers_def;
 u16 rtl8192_11n_user_show_rates(struct net_device *dev);

 #endif
-- 
1.9.1


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


Re: [PATCH] staging: slicoss: Fix prefer ether_addr_copy over memcpy

2014-03-18 Thread Joel Pelaez Jorge

El 17/03/14 23:49, Jingoo Han escribió:

On Tuesday, March 18, 2014 2:04 PM, Joel Pelaez Jorge wrote:



@@ -810,8 +810,8 @@ static int slic_mac_set_address(struct net_device
*dev, void *ptr)
if (!is_valid_ether_addr(addr->sa_data))
return -EINVAL;

-   memcpy(dev->dev_addr, addr->sa_data, dev->addr_len);
-   memcpy(adapter->currmacaddr, addr->sa_data, dev->addr_len);
+   ether_addr_copy(dev->dev_addr, addr->sa_data);
+   ether_addr_copy(adapter->currmacaddr, addr->sa_data);


By the way, I am wondering if 'dev->addr_len' is 6 bytes.
Is there anyone who can confirm it?

If nobody can confirm 'dev->addr_len' is 6 bytes, it should
not be changed to 'ether_addr_copy()'.

Best regards,
Jingoo Han

In the first case, is necessary use memcpy for copy te ethernet address 
to dev->dev_addr because this is a pointer, uses dev->addr_len for 
define size.


But in the second, adapter->currmacaddr is fixed to 6 size, so that here 
one can use ether_addr_copy without issues.


--
Best regards,
Joel Pelaez Jorge
Joel Pelaez Jorge


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


Re: [PATCH] staging: slicoss: Fix prefer ether_addr_copy over memcpy

2014-03-18 Thread Joel Pelaez Jorge

El 17/03/14 23:49, Jingoo Han escribió:

On Tuesday, March 18, 2014 2:04 PM, Joel Pelaez Jorge wrote:



@@ -810,8 +810,8 @@ static int slic_mac_set_address(struct net_device
*dev, void *ptr)
if (!is_valid_ether_addr(addr-sa_data))
return -EINVAL;

-   memcpy(dev-dev_addr, addr-sa_data, dev-addr_len);
-   memcpy(adapter-currmacaddr, addr-sa_data, dev-addr_len);
+   ether_addr_copy(dev-dev_addr, addr-sa_data);
+   ether_addr_copy(adapter-currmacaddr, addr-sa_data);


By the way, I am wondering if 'dev-addr_len' is 6 bytes.
Is there anyone who can confirm it?

If nobody can confirm 'dev-addr_len' is 6 bytes, it should
not be changed to 'ether_addr_copy()'.

Best regards,
Jingoo Han

In the first case, is necessary use memcpy for copy te ethernet address 
to dev-dev_addr because this is a pointer, uses dev-addr_len for 
define size.


But in the second, adapter-currmacaddr is fixed to 6 size, so that here 
one can use ether_addr_copy without issues.


--
Best regards,
Joel Pelaez Jorge
Joel Pelaez Jorge


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


[PATCH] staging: slicoss: Fix prefer ether_addr_copy over memcpy

2014-03-17 Thread Joel Pelaez Jorge
This patch fixes the following checkpatch.pl issues caused by the new 
function: ether_addr_copy


Signed-off-by: Joel Pelaez Jorge 
---
 drivers/staging/slicoss/slicoss.c |   20 ++--
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/drivers/staging/slicoss/slicoss.c 
b/drivers/staging/slicoss/slicoss.c

index 12aafe3..0e0e374 100644
--- a/drivers/staging/slicoss/slicoss.c
+++ b/drivers/staging/slicoss/slicoss.c
@@ -581,15 +581,15 @@ static void slic_adapter_set_hwaddr(struct adapter 
*adapter)

struct sliccard *card = adapter->card;

if ((adapter->card) && (card->config_set)) {
-   memcpy(adapter->macaddr,
-  card->config.MacInfo[adapter->functionnumber].macaddrA,
-  sizeof(struct slic_config_mac));
+   ether_addr_copy(adapter->macaddr,
+   card->config.MacInfo[adapter->functionnumber]
+   .macaddrA);
if (is_zero_ether_addr(adapter->currmacaddr))
-   memcpy(adapter->currmacaddr, adapter->macaddr,
-  ETH_ALEN);
+   ether_addr_copy(adapter->currmacaddr,
+   adapter->macaddr);
if (adapter->netdev)
-   memcpy(adapter->netdev->dev_addr, adapter->currmacaddr,
-  ETH_ALEN);
+   ether_addr_copy(adapter->netdev->dev_addr,
+   adapter->currmacaddr);
}
 }

@@ -810,8 +810,8 @@ static int slic_mac_set_address(struct net_device 
*dev, void *ptr)

if (!is_valid_ether_addr(addr->sa_data))
return -EINVAL;

-   memcpy(dev->dev_addr, addr->sa_data, dev->addr_len);
-   memcpy(adapter->currmacaddr, addr->sa_data, dev->addr_len);
+   ether_addr_copy(dev->dev_addr, addr->sa_data);
+   ether_addr_copy(adapter->currmacaddr, addr->sa_data);

slic_config_set(adapter, true);
return 0;
@@ -2313,7 +2313,7 @@ static int slic_mcast_add_list(struct adapter 
*adapter, char *address)

if (mcaddr == NULL)
return 1;

-   memcpy(mcaddr->address, address, ETH_ALEN);
+   ether_addr_copy(mcaddr->address, address);

mcaddr->next = adapter->mcastaddrs;
adapter->mcastaddrs = mcaddr;
--
1.7.10.4

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


[PATCH] staging: slicoss: Fix prefer ether_addr_copy over memcpy

2014-03-17 Thread Joel Pelaez Jorge
This patch fixes the following checkpatch.pl issues caused by the new 
function: ether_addr_copy


Signed-off-by: Joel Pelaez Jorge 
---
diff --git a/drivers/staging/slicoss/slicoss.c 
b/drivers/staging/slicoss/slicoss.c

index 12aafe3..4ff39aa 100644
--- a/drivers/staging/slicoss/slicoss.c
+++ b/drivers/staging/slicoss/slicoss.c
@@ -2313,7 +2313,7 @@ static int slic_mcast_add_list(struct adapter 
*adapter, char *address)

 if (mcaddr == NULL)
 return 1;

-memcpy(mcaddr->address, address, ETH_ALEN);
+ether_addr_copy(mcaddr->address, address);

 mcaddr->next = adapter->mcastaddrs;
 adapter->mcastaddrs = mcaddr;
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] staging: slicoss: Fix prefer ether_addr_copy over memcpy

2014-03-17 Thread Joel Pelaez Jorge
This patch fixes the following checkpatch.pl issues caused by the new 
function: ether_addr_copy


Signed-off-by: Joel Pelaez Jorge joelpel...@gmail.com
---
diff --git a/drivers/staging/slicoss/slicoss.c 
b/drivers/staging/slicoss/slicoss.c

index 12aafe3..4ff39aa 100644
--- a/drivers/staging/slicoss/slicoss.c
+++ b/drivers/staging/slicoss/slicoss.c
@@ -2313,7 +2313,7 @@ static int slic_mcast_add_list(struct adapter 
*adapter, char *address)

 if (mcaddr == NULL)
 return 1;

-memcpy(mcaddr-address, address, ETH_ALEN);
+ether_addr_copy(mcaddr-address, address);

 mcaddr-next = adapter-mcastaddrs;
 adapter-mcastaddrs = mcaddr;
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] staging: slicoss: Fix prefer ether_addr_copy over memcpy

2014-03-17 Thread Joel Pelaez Jorge
This patch fixes the following checkpatch.pl issues caused by the new 
function: ether_addr_copy


Signed-off-by: Joel Pelaez Jorge joelpel...@gmail.com
---
 drivers/staging/slicoss/slicoss.c |   20 ++--
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/drivers/staging/slicoss/slicoss.c 
b/drivers/staging/slicoss/slicoss.c

index 12aafe3..0e0e374 100644
--- a/drivers/staging/slicoss/slicoss.c
+++ b/drivers/staging/slicoss/slicoss.c
@@ -581,15 +581,15 @@ static void slic_adapter_set_hwaddr(struct adapter 
*adapter)

struct sliccard *card = adapter-card;

if ((adapter-card)  (card-config_set)) {
-   memcpy(adapter-macaddr,
-  card-config.MacInfo[adapter-functionnumber].macaddrA,
-  sizeof(struct slic_config_mac));
+   ether_addr_copy(adapter-macaddr,
+   card-config.MacInfo[adapter-functionnumber]
+   .macaddrA);
if (is_zero_ether_addr(adapter-currmacaddr))
-   memcpy(adapter-currmacaddr, adapter-macaddr,
-  ETH_ALEN);
+   ether_addr_copy(adapter-currmacaddr,
+   adapter-macaddr);
if (adapter-netdev)
-   memcpy(adapter-netdev-dev_addr, adapter-currmacaddr,
-  ETH_ALEN);
+   ether_addr_copy(adapter-netdev-dev_addr,
+   adapter-currmacaddr);
}
 }

@@ -810,8 +810,8 @@ static int slic_mac_set_address(struct net_device 
*dev, void *ptr)

if (!is_valid_ether_addr(addr-sa_data))
return -EINVAL;

-   memcpy(dev-dev_addr, addr-sa_data, dev-addr_len);
-   memcpy(adapter-currmacaddr, addr-sa_data, dev-addr_len);
+   ether_addr_copy(dev-dev_addr, addr-sa_data);
+   ether_addr_copy(adapter-currmacaddr, addr-sa_data);

slic_config_set(adapter, true);
return 0;
@@ -2313,7 +2313,7 @@ static int slic_mcast_add_list(struct adapter 
*adapter, char *address)

if (mcaddr == NULL)
return 1;

-   memcpy(mcaddr-address, address, ETH_ALEN);
+   ether_addr_copy(mcaddr-address, address);

mcaddr-next = adapter-mcastaddrs;
adapter-mcastaddrs = mcaddr;
--
1.7.10.4

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