diff mbox

[OPW,kernel] Staging:wlan-ng: Fix Sparse Warnings

Message ID 1393972091-26264-1-git-send-email-ebru.akagunduz@gmail.com
State New, archived
Headers show

Commit Message

Ebru Akagündüz March 4, 2014, 10:28 p.m. UTC
This patch fixes the following type of sparse warnings:

drivers/staging/wlan-ng/cfg80211.c:710:13: warning: ‘prism2_connect_result’ defined but not used [-Wunused-function]
drivers/staging/wlan-ng/cfg80211.c:719:13: warning: ‘prism2_disconnected’ defined but not used [-Wunused-function]
drivers/staging/wlan-ng/cfg80211.c:725:13: warning: ‘prism2_roamed’ defined but not used [-Wunused-function]
drivers/staging/wlan-ng/cfg80211.c:752:14: warning: symbol 'wlan_create_wiphy' was not declared. Should it be static?
drivers/staging/wlan-ng/cfg80211.c:789:6: warning: symbol 'wlan_free_wiphy' was not declared. Should it be static?

Signed-off-by: Ebru Akagunduz <ebru.akagunduz@gmail.com>
---
 drivers/staging/wlan-ng/cfg80211.c | 30 ++----------------------------
 1 file changed, 2 insertions(+), 28 deletions(-)

Comments

Greg Kroah-Hartman March 7, 2014, 9:43 p.m. UTC | #1
On Wed, Mar 05, 2014 at 12:28:11AM +0200, Ebru Akagunduz wrote:
> This patch fixes the following type of sparse warnings:
> 
> drivers/staging/wlan-ng/cfg80211.c:710:13: warning: ‘prism2_connect_result’ defined but not used [-Wunused-function]
> drivers/staging/wlan-ng/cfg80211.c:719:13: warning: ‘prism2_disconnected’ defined but not used [-Wunused-function]
> drivers/staging/wlan-ng/cfg80211.c:725:13: warning: ‘prism2_roamed’ defined but not used [-Wunused-function]
> drivers/staging/wlan-ng/cfg80211.c:752:14: warning: symbol 'wlan_create_wiphy' was not declared. Should it be static?
> drivers/staging/wlan-ng/cfg80211.c:789:6: warning: symbol 'wlan_free_wiphy' was not declared. Should it be static?
> 
> Signed-off-by: Ebru Akagunduz <ebru.akagunduz@gmail.com>
> ---
>  drivers/staging/wlan-ng/cfg80211.c | 30 ++----------------------------
>  1 file changed, 2 insertions(+), 28 deletions(-)

You didn't test this patch, and it broke the build :(
Ebru Akagündüz March 7, 2014, 9:48 p.m. UTC | #2
>
>
> I get only below warnig. The patch doesn't add any new warning or error
when I compiled it.

drivers/staging/wlan-ng/prism2fw.c: In function 'read_cardpda.constprop.28':
drivers/staging/wlan-ng/prism2fw.c:795:1: warning: the frame size of 1068
bytes is larger than 1024 bytes [-Wframe-larger-than=]
Ebru Akagündüz March 7, 2014, 9:51 p.m. UTC | #3
I meant the driver already has the warning, the patch didn't add it.
Greg Kroah-Hartman March 7, 2014, 10:04 p.m. UTC | #4
On Fri, Mar 07, 2014 at 11:48:56PM +0200, Ebru Akagunduz wrote:
> 
> 
> I get only below warnig. The patch doesn't add any new warning or error when I
> compiled it.
> 
> drivers/staging/wlan-ng/prism2fw.c: In function ‘read_cardpda.constprop.28’:
> drivers/staging/wlan-ng/prism2fw.c:795:1: warning: the frame size of 1068 bytes
> is larger than 1024 bytes [-Wframe-larger-than=] 

What happened to my response, please always quote it as us kernel
maintainers have the short-term memory of a squirrel, I get over 1000
emails a day to handle and don't remember what I just did 5 minutes
ago...

Anyway, please try it again, this patch broke my build, and if you use
'grep' you can see why it did.

thanks,

greg k-h
diff mbox

Patch

diff --git a/drivers/staging/wlan-ng/cfg80211.c b/drivers/staging/wlan-ng/cfg80211.c
index 6c31730..0d73908 100644
--- a/drivers/staging/wlan-ng/cfg80211.c
+++ b/drivers/staging/wlan-ng/cfg80211.c
@@ -703,32 +703,6 @@  exit:
 	return err;
 }
 
-
-
-
-/* Interface callback functions, passing data back up to the cfg80211 layer */
-void prism2_connect_result(wlandevice_t *wlandev, u8 failed)
-{
-	u16 status = failed ?
-		     WLAN_STATUS_UNSPECIFIED_FAILURE : WLAN_STATUS_SUCCESS;
-
-	cfg80211_connect_result(wlandev->netdev, wlandev->bssid,
-				NULL, 0, NULL, 0, status, GFP_KERNEL);
-}
-
-void prism2_disconnected(wlandevice_t *wlandev)
-{
-	cfg80211_disconnected(wlandev->netdev, 0, NULL,
-		0, GFP_KERNEL);
-}
-
-void prism2_roamed(wlandevice_t *wlandev)
-{
-	cfg80211_roamed(wlandev->netdev, NULL, wlandev->bssid,
-		NULL, 0, NULL, 0, GFP_KERNEL);
-}
-
-
 /* Structures for declaring wiphy interface */
 static const struct cfg80211_ops prism2_usb_cfg_ops = {
 	.change_virtual_intf = prism2_change_virtual_intf,
@@ -749,7 +723,7 @@  static const struct cfg80211_ops prism2_usb_cfg_ops = {
 
 
 /* Functions to create/free wiphy interface */
-struct wiphy *wlan_create_wiphy(struct device *dev, wlandevice_t *wlandev)
+static struct wiphy *wlan_create_wiphy(struct device *dev, wlandevice_t *wlandev)
 {
 	struct wiphy *wiphy;
 	struct prism2_wiphy_private *priv;
@@ -786,7 +760,7 @@  struct wiphy *wlan_create_wiphy(struct device *dev, wlandevice_t *wlandev)
 }
 
 
-void wlan_free_wiphy(struct wiphy *wiphy)
+static void wlan_free_wiphy(struct wiphy *wiphy)
 {
 	wiphy_unregister(wiphy);
 	wiphy_free(wiphy);