[PATCH 3/7] powerpc/powernv: replace sscanf %lx by kstrtoul 16

From: Fabian Frederick
Date: Sat Jul 12 2014 - 07:37:08 EST


See checkpatch warning
"Prefer kstrto<type> to single variable sscanf"

Signed-off-by: Fabian Frederick <fabf@xxxxxxxxx>
---
arch/powerpc/platforms/powernv/subcore.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/powerpc/platforms/powernv/subcore.c b/arch/powerpc/platforms/powernv/subcore.c
index 894ecb3..79721b2 100644
--- a/arch/powerpc/platforms/powernv/subcore.c
+++ b/arch/powerpc/platforms/powernv/subcore.c
@@ -337,9 +337,9 @@ static ssize_t __used store_subcores_per_core(struct device *dev,

/* We are serialised by the attribute lock */

- rc = sscanf(buf, "%lx", &val);
- if (rc != 1)
- return -EINVAL;
+ rc = kstrtoul(buf, 16, &val);
+ if (rc)
+ return rc;

switch (val) {
case 1:
--
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/