staging: ks7010: remove some dead code from ks_wlan_set_essid function
authorSergio Paracuellos <sergio.paracuellos@gmail.com>
Wed, 28 Mar 2018 15:24:25 +0000 (17:24 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 29 Mar 2018 09:49:12 +0000 (11:49 +0200)
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>
drivers/staging/ks7010/ks_wlan_net.c

index 6106e79c51635a3e110db949ee22e813c86708d9..4019f3a904b06f340228483c39e36680c5acaef9 100644 (file)
@@ -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;