Skip to content

Commit

Permalink
ctcm: replace sscanf by kstrto function
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Thomas Richter authored and David S. Miller committed Oct 27, 2014
1 parent 786f006 commit 652d77b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions drivers/s390/net/ctcm_sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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) ||
Expand Down

0 comments on commit 652d77b

Please sign in to comment.