diff options
author | Lendacky, Thomas <Thomas.Lendacky@amd.com> | 2014-06-24 16:19:35 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-06-26 17:14:04 -0700 |
commit | 66f95c35c413f674a835034dc667099b44225df2 (patch) | |
tree | d0c63d120b8f0a27afde54a8802eb2975e865b3f /drivers/net/ethernet/amd/xgbe/xgbe-debugfs.c | |
parent | b85e4d8960f10e4b28613a3e7b76f8889a2089e3 (diff) |
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: Tom Lendacky <thomas.lendacky@amd.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/amd/xgbe/xgbe-debugfs.c')
-rw-r--r-- | drivers/net/ethernet/amd/xgbe/xgbe-debugfs.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/net/ethernet/amd/xgbe/xgbe-debugfs.c b/drivers/net/ethernet/amd/xgbe/xgbe-debugfs.c index 6bb76d5c817b..81198587a6c6 100644 --- a/drivers/net/ethernet/amd/xgbe/xgbe-debugfs.c +++ b/drivers/net/ethernet/amd/xgbe/xgbe-debugfs.c @@ -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; } |