Staging: wlan-ng: Remove unused variables.
cover Staging: wlan-ng: Remove unused variables.
These patches were detected by the following
Coccinelle script :
@@
identifier f, ret;
type T;
@@
(
- ret =
+ return
f(...);
- return ret;
|
- T ret =
+ return
f(...);
- return ret;
)
Vatika Harlalka (3):
Staging: wlan-ng: Remove unused variable
Staging: wlan-ng: Remove unused variable
Staging: wlan-ng: Remove unused variable
drivers/staging/wlan-ng/hfa384x_usb.c | 16 ++++------------ drivers/staging/wlan-ng/prism2mib.c | 12 +++--------- drivers/staging/wlan-ng/prism2sta.c | 4 +--- 3 files changed, 8 insertions(+), 24 deletions(-)
Signature · 1 line
1.9.1
PATCH 1/3 Staging: wlan-ng: Remove unused variable
--- drivers/staging/wlan-ng/hfa384x_usb.c | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-)
drivers/staging/wlan-ng/hfa384x_usb.c +4 -12
@@ -1025,9 +1025,7 @@ int hfa384x_cmd_disable(hfa384x_t *hw, u16 macport) cmd.parm1 =0 ; cmd.parm2 =0 ; - result =hfa384x_docmd_wait (hw, &cmd); - -return result; +return hfa384x_docmd_wait (hw, &cmd); }/*----------------------------------------------------------------
@@ -1061,9 +1059,7 @@ int hfa384x_cmd_enable(hfa384x_t *hw, u16 macport) cmd.parm1 =0 ; cmd.parm2 =0 ; - result =hfa384x_docmd_wait (hw, &cmd); - -return result; +return hfa384x_docmd_wait (hw, &cmd); }/*----------------------------------------------------------------
@@ -1106,9 +1102,7 @@ int hfa384x_cmd_monitor(hfa384x_t *hw, u16 enable) cmd.parm1 =0 ; cmd.parm2 =0 ; - result =hfa384x_docmd_wait (hw, &cmd); - -return result; +return hfa384x_docmd_wait (hw, &cmd); }/*----------------------------------------------------------------
@@ -1165,9 +1159,7 @@ int hfa384x_cmd_download(hfa384x_t *hw, u16 mode, u16 lowaddr, cmd.parm1 = highaddr; cmd.parm2 = codelen; - result =hfa384x_docmd_wait (hw, &cmd); - -return result; +return hfa384x_docmd_wait (hw, &cmd); }/*----------------------------------------------------------------
Signature · 1 line
1.9.1
PATCH 2/3 Staging: wlan-ng: Remove unused variable
In reply to Vatika HarlalkaThe return value of the function need not be
assigned to a variable.
--- drivers/staging/wlan-ng/prism2mib.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-)
drivers/staging/wlan-ng/prism2mib.c +3 -9
@@ -591,9 +591,7 @@ static int prism2mib_privacyinvoked(struct mibrec *mib, mib->parm2 |= HFA384x_WEPFLAGS_DISABLE_TXCRYPT; } - result =prism2mib_flag (mib, isget, wlandev, hw, msg, data); - -return result; +return prism2mib_flag (mib, isget, wlandev, hw, msg, data); }/*----------------------------------------------------------------
@@ -630,9 +628,7 @@ static int prism2mib_excludeunencrypted(struct mibrec *mib, {int result; - result =prism2mib_flag (mib, isget, wlandev, hw, msg, data); - -return result; +return prism2mib_flag (mib, isget, wlandev, hw, msg, data); }/*----------------------------------------------------------------
@@ -679,9 +675,7 @@ static int prism2mib_fragmentationthreshold(struct mibrec *mib,return 0 ; } - result =prism2mib_uint32 (mib, isget, wlandev, hw, msg, data); - -return result; +return prism2mib_uint32 (mib, isget, wlandev, hw, msg, data); }/*----------------------------------------------------------------
Signature · 1 line
1.9.1
PATCH 3/3 Staging: wlan-ng: Remove unused variable
In reply to Vatika HarlalkaThe return value of the function need not be
assigned to a variable.
--- drivers/staging/wlan-ng/prism2sta.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/staging/wlan-ng/prism2sta.c +1 -3
@@ -251,9 +251,7 @@ static int prism2sta_txframe(wlandevice_t *wlandev, struct sk_buff *skb, p80211_hdr->a3.fc |=cpu_to_le16 (WLAN_SET_FC_ISWEP (1 )); } - result =hfa384x_drvr_txframe (hw, skb, p80211_hdr, p80211_wep); - -return result; +return hfa384x_drvr_txframe (hw, skb, p80211_hdr, p80211_wep); }/*----------------------------------------------------------------
Signature · 1 line
1.9.1
Re: [Outreachy kernel] [PATCH 3/3] Staging: wlan-ng: Remove unused variable
Quoted 13 lines · Vatika Harlalka
The return value of the function need not be
assigned to a variable.Signed-off-by Vatika Harlalka <[email protected]>--- drivers/staging/wlan-ng/prism2sta.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)drivers/staging/wlan-ng/prism2sta.c +0
-0
drivers/staging/wlan-ng/prism2sta.c static int prism2sta_txframe(wlandevice_t *wlandev, struct sk_buff *skb, · line 254
Quoted 7 lines
drivers/staging/wlan-ng/prism2sta.c +1
-3@@ -251,9 +251,7 @@ static int prism2sta_txframe(wlandevice_t *wlandev, struct sk_buff *skb, p80211_hdr->a3.fc |=cpu_to_le16 (WLAN_SET_FC_ISWEP (1 )); } - result =hfa384x_drvr_txframe (hw, skb, p80211_hdr, p80211_wep); - -return result; +return hfa384x_drvr_txframe (hw, skb, p80211_hdr, p80211_wep);
Now you can get rid of the result variable.
julia
Quoted 13 lines
drivers/staging/wlan-ng/prism2sta.c +0
-1}/*---------------------------------------------------------------- -- 1.9.1
--
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/922d52e4f30f851b2c893faa720b87b57dc82812.1425223729.git.vatikaharlalka%40gmail.com.
For more options, visit https://groups.google.com/d/optout.
Greg KH
maintainerQuoted 20 lines · Vatika Harlalka
These patches were detected by the following
Coccinelle script :
@@
identifier f, ret;
type T;
@@
(
- ret =
+ return
f(...);
- return ret;|
- T ret =
+ return
f(...);
- return ret;
)
Quoted 4 lines
Vatika Harlalka (3):
Staging: wlan-ng: Remove unused variable
Staging: wlan-ng: Remove unused variable
Staging: wlan-ng: Remove unused variable
3 patches all with the same name, please fix up and resend.
thanks,
greg k-h