* [PATCH v3] Staging: rtl8192e: Fix declaration of symbols
@ 2014-04-07 2:26 Joel Pelaez Jorge
2014-04-08 8:20 ` Dan Carpenter
0 siblings, 1 reply; 2+ messages in thread
From: Joel Pelaez Jorge @ 2014-04-07 2:26 UTC (permalink / raw)
To: Greg Kroah-Hartman, Silvan Jegen; +Cc: devel, linux-kernel
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 <joelpelaez@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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH v3] Staging: rtl8192e: Fix declaration of symbols
2014-04-07 2:26 [PATCH v3] Staging: rtl8192e: Fix declaration of symbols Joel Pelaez Jorge
@ 2014-04-08 8:20 ` Dan Carpenter
0 siblings, 0 replies; 2+ messages in thread
From: Dan Carpenter @ 2014-04-08 8:20 UTC (permalink / raw)
To: Joel Pelaez Jorge; +Cc: Greg Kroah-Hartman, Silvan Jegen, devel, linux-kernel
On Sun, Apr 06, 2014 at 09:26:55PM -0500, Joel Pelaez Jorge wrote:
> --- 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)
This patch is line-wrapped and doesn't apply. Read
Documentation/email-clients.txt or use git send-email.
regards,
dan carpenter
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-04-08 8:20 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-07 2:26 [PATCH v3] Staging: rtl8192e: Fix declaration of symbols Joel Pelaez Jorge
2014-04-08 8:20 ` Dan Carpenter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).