Commit aac22d07 authored by Julia Lawall's avatar Julia Lawall Committed by Greg Kroah-Hartman

staging: wlags49_h2: make return of 0 explicit

Delete unnecessary local variable whose value is always 0 and that hides
the fact that the result is always 0.

A simplified version of the semantic patch that fixes this problem is as
follows: (http://coccinelle.lip6.fr/)

// <smpl>
@r exists@
local idexpression ret;
expression e;
position p;
@@

-ret = 0;
... when != ret = e
return
- ret
+ 0
  ;
// </smpl>
Signed-off-by: default avatarJulia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 27ea2f16
...@@ -159,15 +159,12 @@ static int hermes_set_tkip_keys(ltv_t *ltv, u16 key_idx, u8 *addr, ...@@ -159,15 +159,12 @@ static int hermes_set_tkip_keys(ltv_t *ltv, u16 key_idx, u8 *addr,
/* Set up the LTV to clear the appropriate key */ /* Set up the LTV to clear the appropriate key */
static int hermes_clear_tkip_keys(ltv_t *ltv, u16 key_idx, u8 *addr) static int hermes_clear_tkip_keys(ltv_t *ltv, u16 key_idx, u8 *addr)
{ {
int ret;
switch (key_idx) { switch (key_idx) {
case 0: case 0:
if (!is_broadcast_ether_addr(addr)) { if (!is_broadcast_ether_addr(addr)) {
ltv->len = 7; ltv->len = 7;
ltv->typ = CFG_REMOVE_TKIP_MAPPED_KEY; ltv->typ = CFG_REMOVE_TKIP_MAPPED_KEY;
memcpy(&ltv->u.u8[0], addr, ETH_ALEN); memcpy(&ltv->u.u8[0], addr, ETH_ALEN);
ret = 0;
} }
break; break;
case 1: case 1:
...@@ -178,13 +175,12 @@ static int hermes_clear_tkip_keys(ltv_t *ltv, u16 key_idx, u8 *addr) ...@@ -178,13 +175,12 @@ static int hermes_clear_tkip_keys(ltv_t *ltv, u16 key_idx, u8 *addr)
ltv->typ = CFG_REMOVE_TKIP_DEFAULT_KEY; ltv->typ = CFG_REMOVE_TKIP_DEFAULT_KEY;
ltv->u.u16[0] = cpu_to_le16(key_idx); ltv->u.u16[0] = cpu_to_le16(key_idx);
ret = 0;
break; break;
default: default:
break; break;
} }
return ret; return 0;
} }
/* Set the WEP keys in the wl_private structure */ /* Set the WEP keys in the wl_private structure */
...@@ -3027,13 +3023,10 @@ static int wireless_set_genie(struct net_device *dev, ...@@ -3027,13 +3023,10 @@ static int wireless_set_genie(struct net_device *dev,
struct iw_point *data, char *extra) struct iw_point *data, char *extra)
{ {
int ret = 0;
/* We can't write this to the card, but apparently this /* We can't write this to the card, but apparently this
* operation needs to succeed */ * operation needs to succeed */
ret = 0;
return ret; return 0;
} }
/*============================================================================*/ /*============================================================================*/
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment