From: Lendacky, Thomas Date: Tue, 24 Jun 2014 21:19:35 +0000 (-0500) Subject: amd-xgbe: Resolve checkpatch warning about sscanf usage X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=66f95c35c413f674a835034dc667099b44225df2;p=linux-beck.git amd-xgbe: Resolve checkpatch warning about sscanf usage Checkpatch issued a warning preferring to use kstrto when using a single variable sscanf. Change the sscanf invocation to a kstrtouint call. Signed-off-by: Tom Lendacky Signed-off-by: David S. Miller --- 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; }