Commit 8f4d00cd authored by Shiva Kerdel's avatar Shiva Kerdel Committed by Greg Kroah-Hartman

Staging: ks7010: ks_*: Braces should be used on all arms of these statements

Braces should be used on all arms of these statements (CHECK)..
Signed-off-by: default avatarShiva Kerdel <shiva@exdev.nl>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent f3f45c73
...@@ -2146,9 +2146,10 @@ void hostif_sme_mode_setup(struct ks_wlan_private *priv) ...@@ -2146,9 +2146,10 @@ void hostif_sme_mode_setup(struct ks_wlan_private *priv)
else else
rate_octet[i] = rate_octet[i] =
priv->reg.rate_set.body[i]; priv->reg.rate_set.body[i];
} else } else {
break; break;
} }
}
} else { /* D_11G_ONLY_MODE or D_11BG_COMPATIBLE_MODE */ } else { /* D_11G_ONLY_MODE or D_11BG_COMPATIBLE_MODE */
for (i = 0; i < priv->reg.rate_set.size; i++) { for (i = 0; i < priv->reg.rate_set.size; i++) {
...@@ -2161,10 +2162,11 @@ void hostif_sme_mode_setup(struct ks_wlan_private *priv) ...@@ -2161,10 +2162,11 @@ void hostif_sme_mode_setup(struct ks_wlan_private *priv)
else else
rate_octet[i] = rate_octet[i] =
priv->reg.rate_set.body[i]; priv->reg.rate_set.body[i];
} else } else {
break; break;
} }
} }
}
rate_size = i; rate_size = i;
if (rate_size == 0) { if (rate_size == 0) {
if (priv->reg.phy_type == D_11G_ONLY_MODE) if (priv->reg.phy_type == D_11G_ONLY_MODE)
......
...@@ -225,9 +225,9 @@ static int ks_wlan_set_freq(struct net_device *dev, ...@@ -225,9 +225,9 @@ static int ks_wlan_set_freq(struct net_device *dev,
fwrq->m = c + 1; fwrq->m = c + 1;
} }
/* Setting by channel number */ /* Setting by channel number */
if ((fwrq->m > 1000) || (fwrq->e > 0)) if ((fwrq->m > 1000) || (fwrq->e > 0)) {
rc = -EOPNOTSUPP; rc = -EOPNOTSUPP;
else { } else {
int channel = fwrq->m; int channel = fwrq->m;
/* We should do a better check than that, /* We should do a better check than that,
* based on the card capability !!! */ * based on the card capability !!! */
...@@ -977,11 +977,12 @@ static int ks_wlan_set_encode(struct net_device *dev, ...@@ -977,11 +977,12 @@ static int ks_wlan_set_encode(struct net_device *dev,
if (priv->reg.wep_key[index].size) { if (priv->reg.wep_key[index].size) {
priv->reg.wep_index = index; priv->reg.wep_index = index;
priv->need_commit |= SME_WEP_INDEX; priv->need_commit |= SME_WEP_INDEX;
} else } else {
return -EINVAL; return -EINVAL;
} }
} }
} }
}
/* Commit the changes if needed */ /* Commit the changes if needed */
if (dwrq->flags & IW_ENCODE_MODE) if (dwrq->flags & IW_ENCODE_MODE)
...@@ -1054,8 +1055,9 @@ static int ks_wlan_get_encode(struct net_device *dev, ...@@ -1054,8 +1055,9 @@ static int ks_wlan_get_encode(struct net_device *dev,
if ((index >= 0) && (index < 4)) if ((index >= 0) && (index < 4))
memcpy(extra, priv->reg.wep_key[index].val, memcpy(extra, priv->reg.wep_key[index].val,
dwrq->length); dwrq->length);
} else } else {
memcpy(extra, zeros, dwrq->length); memcpy(extra, zeros, dwrq->length);
}
#endif #endif
return 0; return 0;
} }
...@@ -1272,8 +1274,9 @@ static int ks_wlan_set_power(struct net_device *dev, ...@@ -1272,8 +1274,9 @@ static int ks_wlan_set_power(struct net_device *dev,
priv->reg.powermgt = POWMGT_SAVE2_MODE; priv->reg.powermgt = POWMGT_SAVE2_MODE;
else else
return -EINVAL; return -EINVAL;
} else } else {
return -EINVAL; return -EINVAL;
}
hostif_sme_enqueue(priv, SME_POW_MNGMT_REQUEST); hostif_sme_enqueue(priv, SME_POW_MNGMT_REQUEST);
...@@ -1942,8 +1945,9 @@ static int ks_wlan_set_encode_ext(struct net_device *dev, ...@@ -1942,8 +1945,9 @@ static int ks_wlan_set_encode_ext(struct net_device *dev,
return -EINVAL; return -EINVAL;
} }
priv->wpa.key[index].alg = enc->alg; priv->wpa.key[index].alg = enc->alg;
} else } else {
return -EINVAL; return -EINVAL;
}
if (commit) { if (commit) {
if (commit & SME_WEP_INDEX) if (commit & SME_WEP_INDEX)
...@@ -2201,8 +2205,9 @@ static int ks_wlan_set_detach(struct net_device *dev, ...@@ -2201,8 +2205,9 @@ static int ks_wlan_set_detach(struct net_device *dev,
} else if (*uwrq == DISCONNECT_STATUS) { /* 1 */ } else if (*uwrq == DISCONNECT_STATUS) { /* 1 */
priv->connect_status |= FORCE_DISCONNECT; priv->connect_status |= FORCE_DISCONNECT;
netif_carrier_off(dev); netif_carrier_off(dev);
} else } else {
return -EINVAL; return -EINVAL;
}
return 0; return 0;
} }
...@@ -2256,8 +2261,9 @@ static int ks_wlan_set_preamble(struct net_device *dev, ...@@ -2256,8 +2261,9 @@ static int ks_wlan_set_preamble(struct net_device *dev,
priv->reg.preamble = LONG_PREAMBLE; priv->reg.preamble = LONG_PREAMBLE;
} else if (*uwrq == SHORT_PREAMBLE) { /* 1 */ } else if (*uwrq == SHORT_PREAMBLE) { /* 1 */
priv->reg.preamble = SHORT_PREAMBLE; priv->reg.preamble = SHORT_PREAMBLE;
} else } else {
return -EINVAL; return -EINVAL;
}
priv->need_commit |= SME_MODE_SET; priv->need_commit |= SME_MODE_SET;
return -EINPROGRESS; /* Call commit handler */ return -EINPROGRESS; /* Call commit handler */
...@@ -2305,8 +2311,9 @@ static int ks_wlan_set_powermgt(struct net_device *dev, ...@@ -2305,8 +2311,9 @@ static int ks_wlan_set_powermgt(struct net_device *dev,
priv->reg.powermgt = POWMGT_SAVE2_MODE; priv->reg.powermgt = POWMGT_SAVE2_MODE;
else else
return -EINVAL; return -EINVAL;
} else } else {
return -EINVAL; return -EINVAL;
}
hostif_sme_enqueue(priv, SME_POW_MNGMT_REQUEST); hostif_sme_enqueue(priv, SME_POW_MNGMT_REQUEST);
...@@ -2346,8 +2353,9 @@ static int ks_wlan_set_scan_type(struct net_device *dev, ...@@ -2346,8 +2353,9 @@ static int ks_wlan_set_scan_type(struct net_device *dev,
priv->reg.scan_type = ACTIVE_SCAN; priv->reg.scan_type = ACTIVE_SCAN;
} else if (*uwrq == PASSIVE_SCAN) { /* 1 */ } else if (*uwrq == PASSIVE_SCAN) { /* 1 */
priv->reg.scan_type = PASSIVE_SCAN; priv->reg.scan_type = PASSIVE_SCAN;
} else } else {
return -EINVAL; return -EINVAL;
}
return 0; return 0;
} }
...@@ -2519,8 +2527,9 @@ static int ks_wlan_set_beacon_lost(struct net_device *dev, ...@@ -2519,8 +2527,9 @@ static int ks_wlan_set_beacon_lost(struct net_device *dev,
if (priv->reg.operation_mode == MODE_INFRASTRUCTURE) { if (priv->reg.operation_mode == MODE_INFRASTRUCTURE) {
priv->need_commit |= SME_MODE_SET; priv->need_commit |= SME_MODE_SET;
return -EINPROGRESS; /* Call commit handler */ return -EINPROGRESS; /* Call commit handler */
} else } else {
return 0; return 0;
}
} }
/*------------------------------------------------------------------*/ /*------------------------------------------------------------------*/
...@@ -2557,8 +2566,9 @@ static int ks_wlan_set_phy_type(struct net_device *dev, ...@@ -2557,8 +2566,9 @@ static int ks_wlan_set_phy_type(struct net_device *dev,
priv->reg.phy_type = D_11G_ONLY_MODE; priv->reg.phy_type = D_11G_ONLY_MODE;
} else if (*uwrq == D_11BG_COMPATIBLE_MODE) { /* 2 */ } else if (*uwrq == D_11BG_COMPATIBLE_MODE) { /* 2 */
priv->reg.phy_type = D_11BG_COMPATIBLE_MODE; priv->reg.phy_type = D_11BG_COMPATIBLE_MODE;
} else } else {
return -EINVAL; return -EINVAL;
}
priv->need_commit |= SME_MODE_SET; priv->need_commit |= SME_MODE_SET;
return -EINPROGRESS; /* Call commit handler */ return -EINPROGRESS; /* Call commit handler */
...@@ -2596,12 +2606,14 @@ static int ks_wlan_set_cts_mode(struct net_device *dev, ...@@ -2596,12 +2606,14 @@ static int ks_wlan_set_cts_mode(struct net_device *dev,
priv->reg.cts_mode = CTS_MODE_FALSE; priv->reg.cts_mode = CTS_MODE_FALSE;
} else if (*uwrq == CTS_MODE_TRUE) { /* 1 */ } else if (*uwrq == CTS_MODE_TRUE) { /* 1 */
if (priv->reg.phy_type == D_11G_ONLY_MODE || if (priv->reg.phy_type == D_11G_ONLY_MODE ||
priv->reg.phy_type == D_11BG_COMPATIBLE_MODE) priv->reg.phy_type == D_11BG_COMPATIBLE_MODE) {
priv->reg.cts_mode = CTS_MODE_TRUE; priv->reg.cts_mode = CTS_MODE_TRUE;
else } else {
priv->reg.cts_mode = CTS_MODE_FALSE; priv->reg.cts_mode = CTS_MODE_FALSE;
} else }
} else {
return -EINVAL; return -EINVAL;
}
priv->need_commit |= SME_MODE_SET; priv->need_commit |= SME_MODE_SET;
return -EINPROGRESS; /* Call commit handler */ return -EINPROGRESS; /* Call commit handler */
......
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