提交 66f95c35 编写于 作者: L Lendacky, Thomas 提交者: David S. Miller

amd-xgbe: Resolve checkpatch warning about sscanf usage

Checkpatch issued a warning preferring to use kstrto<type> when
using a single variable sscanf.  Change the sscanf invocation to
a kstrtouint call.
Signed-off-by: NTom Lendacky <thomas.lendacky@amd.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 b85e4d89
......@@ -151,7 +151,7 @@ static ssize_t xgbe_common_write(const char __user *buffer, size_t count,
{
char workarea[32];
ssize_t len;
unsigned int scan_value;
int ret;
if (*ppos != 0)
return 0;
......@@ -165,10 +165,9 @@ static ssize_t xgbe_common_write(const char __user *buffer, size_t count,
return len;
workarea[len] = '\0';
if (sscanf(workarea, "%x", &scan_value) == 1)
*value = scan_value;
else
return -EIO;
ret = kstrtouint(workarea, 0, value);
if (ret)
return ret;
return len;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册