diff options
author | Thomas Richter <tmricht@linux.vnet.ibm.com> | 2014-10-22 14:18:06 +0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-10-27 05:21:39 +0300 |
commit | 786f00659afd013ee8795083f3966c28323b3a03 (patch) | |
tree | 5cd72e286330d76857e6cc0ef5f9bd6250f0ac60 /drivers/s390 | |
parent | 3d14f661e6ae968689ff51f2f2f9b07d6ef3e3c6 (diff) | |
download | linux-786f00659afd013ee8795083f3966c28323b3a03.tar.xz |
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>
Diffstat (limited to 'drivers/s390')
-rw-r--r-- | drivers/s390/net/lcs.c | 11 |
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 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; |