aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Richter <tmricht@linux.vnet.ibm.com>2014-10-22 06:18:06 -0400
committerDavid S. Miller <davem@davemloft.net>2014-10-26 22:21:39 -0400
commit786f00659afd013ee8795083f3966c28323b3a03 (patch)
tree5cd72e286330d76857e6cc0ef5f9bd6250f0ac60
parent3d14f661e6ae968689ff51f2f2f9b07d6ef3e3c6 (diff)
lcs: replace sscanf by kstrto function
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>
-rw-r--r--drivers/s390/net/lcs.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/s390/net/lcs.c b/drivers/s390/net/lcs.c
index 0a7d87c372b8..92190aa20b9f 100644
--- a/drivers/s390/net/lcs.c
+++ b/drivers/s390/net/lcs.c
@@ -1943,15 +1943,16 @@ static ssize_t
1943lcs_portno_store (struct device *dev, struct device_attribute *attr, const char *buf, size_t count) 1943lcs_portno_store (struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
1944{ 1944{
1945 struct lcs_card *card; 1945 struct lcs_card *card;
1946 int value, rc; 1946 int rc;
1947 s16 value;
1947 1948
1948 card = dev_get_drvdata(dev); 1949 card = dev_get_drvdata(dev);
1949 1950
1950 if (!card) 1951 if (!card)
1951 return 0; 1952 return 0;
1952 1953
1953 rc = sscanf(buf, "%d", &value); 1954 rc = kstrtos16(buf, 0, &value);
1954 if (rc != 1) 1955 if (rc)
1955 return -EINVAL; 1956 return -EINVAL;
1956 /* TODO: sanity checks */ 1957 /* TODO: sanity checks */
1957 card->portno = value; 1958 card->portno = value;
@@ -2007,8 +2008,8 @@ lcs_timeout_store (struct device *dev, struct device_attribute *attr, const char
2007 if (!card) 2008 if (!card)
2008 return 0; 2009 return 0;
2009 2010
2010 rc = sscanf(buf, "%u", &value); 2011 rc = kstrtouint(buf, 0, &value);
2011 if (rc != 1) 2012 if (rc)
2012 return -EINVAL; 2013 return -EINVAL;
2013 /* TODO: sanity checks */ 2014 /* TODO: sanity checks */
2014 card->lancmd_timeout = value; 2015 card->lancmd_timeout = value;