diff options
author | Thomas Richter <tmricht@linux.vnet.ibm.com> | 2014-10-22 10:18:07 (GMT) |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-10-27 02:21:40 (GMT) |
commit | 652d77ba7be01093bf7e83090267533970028b12 (patch) | |
tree | 9987fbb52f202b9b4162edefce8594d8fe328ad2 /drivers | |
parent | 786f00659afd013ee8795083f3966c28323b3a03 (diff) | |
download | linux-652d77ba7be01093bf7e83090267533970028b12.tar.xz |
ctcm: 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')
-rw-r--r-- | drivers/s390/net/ctcm_sysfs.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/s390/net/ctcm_sysfs.c b/drivers/s390/net/ctcm_sysfs.c index 6bcfbbb..47773c4 100644 --- a/drivers/s390/net/ctcm_sysfs.c +++ b/drivers/s390/net/ctcm_sysfs.c @@ -44,8 +44,8 @@ static ssize_t ctcm_buffer_write(struct device *dev, return -ENODEV; } - rc = sscanf(buf, "%u", &bs1); - if (rc != 1) + rc = kstrtouint(buf, 0, &bs1); + if (rc) goto einval; if (bs1 > CTCM_BUFSIZE_LIMIT) goto einval; @@ -151,8 +151,8 @@ static ssize_t ctcm_proto_store(struct device *dev, if (!priv) return -ENODEV; - rc = sscanf(buf, "%d", &value); - if ((rc != 1) || + rc = kstrtoint(buf, 0, &value); + if (rc || !((value == CTCM_PROTO_S390) || (value == CTCM_PROTO_LINUX) || (value == CTCM_PROTO_MPC) || |