Commit 66f95c35 authored by Lendacky, Thomas's avatar Lendacky, Thomas Committed by 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: default avatarTom Lendacky <thomas.lendacky@amd.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent b85e4d89
...@@ -151,7 +151,7 @@ static ssize_t xgbe_common_write(const char __user *buffer, size_t count, ...@@ -151,7 +151,7 @@ static ssize_t xgbe_common_write(const char __user *buffer, size_t count,
{ {
char workarea[32]; char workarea[32];
ssize_t len; ssize_t len;
unsigned int scan_value; int ret;
if (*ppos != 0) if (*ppos != 0)
return 0; return 0;
...@@ -165,10 +165,9 @@ static ssize_t xgbe_common_write(const char __user *buffer, size_t count, ...@@ -165,10 +165,9 @@ static ssize_t xgbe_common_write(const char __user *buffer, size_t count,
return len; return len;
workarea[len] = '\0'; workarea[len] = '\0';
if (sscanf(workarea, "%x", &scan_value) == 1) ret = kstrtouint(workarea, 0, value);
*value = scan_value; if (ret)
else return ret;
return -EIO;
return len; return len;
} }
......
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