staging: ks7010: remove some dead code from ks_wlan_set_essid function
This commit removes death code which is not being used at all. The statements which are contained inside the else block of preprocessor #if 1 directive are no sense. Also remove #if 1 preprocessor stuff just because it is just true and being executed always. This change improves a bit readability of ks_wlan_set_essid function. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
c61cc2cc3b
commit
c0a2a25460
|
@ -276,7 +276,6 @@ static int ks_wlan_set_essid(struct net_device *dev,
|
|||
memset(priv->reg.ssid.body, 0, sizeof(priv->reg.ssid.body));
|
||||
priv->reg.ssid.size = 0;
|
||||
} else {
|
||||
#if 1
|
||||
len = dwrq->length;
|
||||
/* iwconfig uses nul termination in SSID.. */
|
||||
if (len > 0 && extra[len - 1] == '\0')
|
||||
|
@ -286,28 +285,14 @@ static int ks_wlan_set_essid(struct net_device *dev,
|
|||
if (len > IW_ESSID_MAX_SIZE)
|
||||
return -EINVAL;
|
||||
|
||||
#else
|
||||
/* Check the size of the string */
|
||||
if (dwrq->length > IW_ESSID_MAX_SIZE + 1)
|
||||
return -E2BIG;
|
||||
|
||||
#endif
|
||||
|
||||
/* Set the SSID */
|
||||
memset(priv->reg.ssid.body, 0, sizeof(priv->reg.ssid.body));
|
||||
|
||||
#if 1
|
||||
memcpy(priv->reg.ssid.body, extra, len);
|
||||
priv->reg.ssid.size = len;
|
||||
#else
|
||||
memcpy(priv->reg.ssid.body, extra, dwrq->length);
|
||||
priv->reg.ssid.size = dwrq->length;
|
||||
#endif
|
||||
}
|
||||
/* Write it to the card */
|
||||
priv->need_commit |= SME_MODE_SET;
|
||||
|
||||
// return -EINPROGRESS; /* Call commit handler */
|
||||
ks_wlan_setup_parameter(priv, priv->need_commit);
|
||||
priv->need_commit = 0;
|
||||
return 0;
|
||||
|
|
Loading…
Reference in New Issue