]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
lcs: replace sscanf by kstrto function
authorThomas Richter <tmricht@linux.vnet.ibm.com>
Wed, 22 Oct 2014 10:18:06 +0000 (12:18 +0200)
committerDavid S. Miller <davem@davemloft.net>
Mon, 27 Oct 2014 02:21:39 +0000 (22:21 -0400)
Since a single integer value is read from the supplied buffer
use the kstrto functions instead of sscanf.

Signed-off-by: Thomas Richter <tmricht@linux.vnet.ibm.com>
Signed-off-by: Frank Blaschka <blaschka@linux.vnet.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/s390/net/lcs.c

index 0a7d87c372b8414e17c41e05b50cf974e5ba0bd3..92190aa20b9fa1c8940bbdf79c2190bc99033e3d 100644 (file)
@@ -1943,15 +1943,16 @@ static ssize_t
 lcs_portno_store (struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
 {
         struct lcs_card *card;
-       int value, rc;
+       int rc;
+       s16 value;
 
        card = dev_get_drvdata(dev);
 
         if (!card)
                 return 0;
 
-       rc = sscanf(buf, "%d", &value);
-       if (rc != 1)
+       rc = kstrtos16(buf, 0, &value);
+       if (rc)
                return -EINVAL;
         /* TODO: sanity checks */
         card->portno = value;
@@ -2007,8 +2008,8 @@ lcs_timeout_store (struct device *dev, struct device_attribute *attr, const char
         if (!card)
                 return 0;
 
-       rc = sscanf(buf, "%u", &value);
-       if (rc != 1)
+       rc = kstrtouint(buf, 0, &value);
+       if (rc)
                return -EINVAL;
         /* TODO: sanity checks */
         card->lancmd_timeout = value;