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@xxxxxxxxx> --- drivers/staging/ks7010/ks_wlan_net.c | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/drivers/staging/ks7010/ks_wlan_net.c b/drivers/staging/ks7010/ks_wlan_net.c index 6106e79..4019f3a 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; -- 2.7.4 _______________________________________________ devel mailing list devel@xxxxxxxxxxxxxxxxxxxxxx http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel