Staging: rtl8192e: Fix code issues
cover Staging: rtl8192e: Fix code issues
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
--
PATCH 1/2 Staging: rtl8192e: Remove bad 'extern' declaration
Remove extern declaration to a static function:iw_statistics *r8192_get_wireless_stats(struct net_device *dev);
--- drivers/staging/rtl8192e/rtl8192e/rtl_wx.h | 1 - 1 file changed, 1 deletion(-)
(quoted diff) +0 -0
b/drivers/staging/rtl8192e/rtl8192e/rtl_wx.h
index 6a51a25..6437664 100644
drivers/staging/rtl8192e/rtl8192e/rtl_wx.h +0 -1
@@ -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
Signature · 1 line
1.9.1
PATCH 2/2 Staging: rtl8192e: Fix sparse warning
In reply to Joel Pelaez JorgeInclude 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?
--- drivers/staging/rtl8192e/rtl8192e/rtl_wx.c | 1 + 1 file changed, 1 insertion(+)
(quoted diff) +0 -0
b/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c
index 498995d..2de95f3 100644
drivers/staging/rtl8192e/rtl8192e/rtl_wx.c +1 -0
@@ -19,6 +19,7 @@#include <linux/string.h> #include "rtl_core.h" +#include "rtl_wx.h" #define RATE_COUNT 12static u32 rtl8192_rates[] = {
Signature · 1 line
1.9.1
Re: [PATCH 2/2] Staging: rtl8192e: Fix sparse warning
Quoted 6 lines · 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_defr8192_wx_handlers_def;
Likely this extern should be
extern const struct iw_handler_def ...
---
drivers/staging/rtl8192e/rtl8192e/rtl_core.c | 3 +-- drivers/staging/rtl8192e/rtl8192e/rtl_wx.c | 2 +- drivers/staging/rtl8192e/rtl8192e/rtl_wx.h | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-)
drivers/staging/rtl8192e/rtl8192e/rtl_core.c +1 -2
@@ -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 ;
drivers/staging/rtl8192e/rtl8192e/rtl_wx.c +1 -1
@@ -1320,7 +1320,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,
drivers/staging/rtl8192e/rtl8192e/rtl_wx.h +1 -1
@@ -24,7 +24,7 @@ struct net_device;struct iw_handler_def ;struct iw_statistics ; -extern struct iw_handler_def r8192_wx_handlers_def; +extern const 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);
Greg Kroah-Hartman
maintainerQuoted 9 lines · 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
This email says "0/3", yet you only have 2 patches?
confused,
greg k-h