提交 652d77ba 编写于 作者: T Thomas Richter 提交者: David S. Miller

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: NThomas Richter <tmricht@linux.vnet.ibm.com>
Signed-off-by: NFrank Blaschka <blaschka@linux.vnet.ibm.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 786f0065
......@@ -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) ||
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册