Commit 786f0065 authored by Thomas Richter's avatar Thomas Richter Committed by David S. Miller

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: default avatarThomas Richter <tmricht@linux.vnet.ibm.com>
Signed-off-by: default avatarFrank Blaschka <blaschka@linux.vnet.ibm.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 3d14f661
...@@ -1943,15 +1943,16 @@ static ssize_t ...@@ -1943,15 +1943,16 @@ static ssize_t
lcs_portno_store (struct device *dev, struct device_attribute *attr, const char *buf, size_t count) lcs_portno_store (struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
{ {
struct lcs_card *card; struct lcs_card *card;
int value, rc; int rc;
s16 value;
card = dev_get_drvdata(dev); card = dev_get_drvdata(dev);
if (!card) if (!card)
return 0; return 0;
rc = sscanf(buf, "%d", &value); rc = kstrtos16(buf, 0, &value);
if (rc != 1) if (rc)
return -EINVAL; return -EINVAL;
/* TODO: sanity checks */ /* TODO: sanity checks */
card->portno = value; card->portno = value;
...@@ -2007,8 +2008,8 @@ lcs_timeout_store (struct device *dev, struct device_attribute *attr, const char ...@@ -2007,8 +2008,8 @@ lcs_timeout_store (struct device *dev, struct device_attribute *attr, const char
if (!card) if (!card)
return 0; return 0;
rc = sscanf(buf, "%u", &value); rc = kstrtouint(buf, 0, &value);
if (rc != 1) if (rc)
return -EINVAL; return -EINVAL;
/* TODO: sanity checks */ /* TODO: sanity checks */
card->lancmd_timeout = value; card->lancmd_timeout = value;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment