summaryrefslogtreecommitdiffstats
path: root/drivers/staging
diff options
context:
space:
mode:
authorSergio Paracuellos <sergio.paracuellos@gmail.com>2018-03-28 17:24:25 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-03-29 11:49:12 +0200
commitc0a2a25460a755db63750eeea89a74657e7eda0d (patch)
tree30d2955c96c334716f102f5b651ea19f356674aa /drivers/staging
parentc61cc2cc3be358da10121d119356dfe67fe240f2 (diff)
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>
Diffstat (limited to 'drivers/staging')
-rw-r--r--drivers/staging/ks7010/ks_wlan_net.c15
1 files changed, 0 insertions, 15 deletions
diff --git a/drivers/staging/ks7010/ks_wlan_net.c b/drivers/staging/ks7010/ks_wlan_net.c
index 6106e79c5163..4019f3a904b0 100644
--- a/drivers/staging/ks7010/ks_wlan_net.c
+++ b/drivers/staging/ks7010/ks_wlan_net.c
@@ -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;