Skip to contentSkip to conversation

hostap/hostap_ioctl.c Fix variable 'ret' set but not used

PATCH Superseded Justin P. Mattock 3 participants 4 messages Aug 3, 2010 Networking drivers (wireless)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 hostap/hostap_ioctl.c Fix variable 'ret' set but not used

This a resend after receiving feedback on a better solution.

The below patch fixes a warning message generated by GCC:
CC [M] drivers/net/wireless/hostap/hostap_ioctl.o
drivers/net/wireless/hostap/hostap_ioctl.c: In function 'prism2_request_scan':
drivers/net/wireless/hostap/hostap_ioctl.c:1666:6: warning: variable 'ret' set but not used

---
 drivers/net/wireless/hostap/hostap_ioctl.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
drivers/net/wireless/hostap/hostap_ioctl.c +1 -0
index a85e43a..955e070 100644
@@ -1690,6 +1690,7 @@ static int prism2_request_scan(struct net_device *dev)
 				 sizeof(scan_req))) {
 		printk(KERN_DEBUG "SCANREQUEST failed\n");
 		ret = -EINVAL;
+		return ret;
 	}
 
 	if (!local->host_roaming)
Signature · 1 line
1.7.1.rc1.21.gf3bd6
#1 lore raw
Quoted 18 lines · Justin P. Mattock

This a resend after receiving feedback on a better solution.

The below patch fixes a warning message generated by GCC:
 CC [M]  drivers/net/wireless/hostap/hostap_ioctl.o drivers/net/wireless/hostap/hostap_ioctl.c: In function 'prism2_request_scan':
drivers/net/wireless/hostap/hostap_ioctl.c:1666:6: warning: variable 'ret' set but not used

---
 drivers/net/wireless/hostap/hostap_ioctl.c |    1 +

 1 files changed, 1 insertions(+), 0 deletions(-)
drivers/net/wireless/hostap/hostap_ioctl.c +0 -0
index a85e43a..955e070 100644

drivers/net/wireless/hostap/hostap_ioctl.c static int prism2_request_scan(struct net_device *dev) · line 1696

Quoted 7 lines
drivers/net/wireless/hostap/hostap_ioctl.c +1 -0
@@ -1690,6 +1690,7 @@ static int prism2_request_scan(struct net_device *dev)
                                 sizeof(scan_req))) {
                printk(KERN_DEBUG "SCANREQUEST failed\n");
                ret = -EINVAL;
+               return ret;
        }
 
        if (!local->host_roaming)

NACK, just make the routine return the ret instead of 0.

Luis

#2 lore raw
Quoted 26 lines · Luis R. Rodriguez
Quoted 24 lines · Justin P. Mattock

This a resend after receiving feedback on a better solution.

The below patch fixes a warning message generated by GCC:
 CC [M]  drivers/net/wireless/hostap/hostap_ioctl.o drivers/net/wireless/hostap/hostap_ioctl.c: In function 'prism2_request_scan':
drivers/net/wireless/hostap/hostap_ioctl.c:1666:6: warning: variable 'ret' set but not used

---
 drivers/net/wireless/hostap/hostap_ioctl.c |    1 +

 1 files changed, 1 insertions(+), 0 deletions(-)
drivers/net/wireless/hostap/hostap_ioctl.c +1 -0
index a85e43a..955e070 100644
@@ -1690,6 +1690,7 @@ static int prism2_request_scan(struct net_device *dev)
                                 sizeof(scan_req))) {
                printk(KERN_DEBUG "SCANREQUEST failed\n");
                ret = -EINVAL;
+               return ret;
        }
 
Quoted 3 lines

drivers/net/wireless/hostap/hostap_ioctl.c static int prism2_request_scan(struct net_device *dev) · line 1696

Quoted 1 line
drivers/net/wireless/hostap/hostap_ioctl.c +0 -0
        if (!local->host_roaming)

NACK, just make the routine return the ret instead of 0.

As in something along the lines of:

hostap_ioctl.c~new renamed from hostap_ioctl.c +1 -1
@@ -1696,7 +1696,7 @@
 		hostap_set_word(dev, HFA384X_RID_CNFROAMINGMODE,
 				HFA384X_ROAMING_FIRMWARE);
 
-	return 0;
+	return ret;
 }
 
 #else /* !PRISM2_NO_STATION_MODES */

(whitespace damange, missing paths, and incorrect names are intentional)

Thanks,

Signature · 4 lines
Julian Calaby

Email: [email protected]
.Plan: http://sites.google.com/site/juliancalaby/
#3 lore raw
Quoted 45 lines · Julian Calaby
Quoted 26 lines · Luis R. Rodriguez
Quoted 24 lines · Justin P. Mattock

This a resend after receiving feedback on a better solution.

The below patch fixes a warning message generated by GCC:
CC [M] drivers/net/wireless/hostap/hostap_ioctl.o
drivers/net/wireless/hostap/hostap_ioctl.c: In function 'prism2_request_scan':
drivers/net/wireless/hostap/hostap_ioctl.c:1666:6: warning: variable 'ret' set but not used

---
  drivers/net/wireless/hostap/hostap_ioctl.c |    1 +
  1 files changed, 1 insertions(+), 0 deletions(-)
drivers/net/wireless/hostap/hostap_ioctl.c +1 -0
index a85e43a..955e070 100644
@@ -1690,6 +1690,7 @@ static int prism2_request_scan(struct net_device *dev)
                                 sizeof(scan_req))) {
                printk(KERN_DEBUG "SCANREQUEST failed\n");
                ret = -EINVAL;
+               return ret;
        }
 
Quoted 3 lines

drivers/net/wireless/hostap/hostap_ioctl.c static int prism2_request_scan(struct net_device *dev) · line 1696

Quoted 1 line
drivers/net/wireless/hostap/hostap_ioctl.c +0 -0
        if (!local->host_roaming)

NACK, just make the routine return the ret instead of 0.

As in something along the lines of:

hostap_ioctl.c~new renamed from hostap_ioctl.c +1 -1
@@ -1696,7 +1696,7 @@
  		hostap_set_word(dev, HFA384X_RID_CNFROAMINGMODE,
  				HFA384X_ROAMING_FIRMWARE);
 
-	return 0;
+	return ret;
  }
 
  #else /* !PRISM2_NO_STATION_MODES */
Quoted 4 lines

(whitespace damange, missing paths, and incorrect names are intentional)

Thanks,

ahh.. now I see.. so no EINVAL just 0.
let me resend.

Justin P. Mattock