[PATCH 6/7] powerpc/cell: replace sscanf by kstrtouint
Fabian Frederick
fabf at skynet.be
Sat Jul 12 21:36:19 EST 2014
See checkpatch warning
"Prefer kstrto<type> to single variable sscanf"
Signed-off-by: Fabian Frederick <fabf at skynet.be>
---
arch/powerpc/platforms/cell/cbe_thermal.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/powerpc/platforms/cell/cbe_thermal.c b/arch/powerpc/platforms/cell/cbe_thermal.c
index 2c15ff0..d71c3c4 100644
--- a/arch/powerpc/platforms/cell/cbe_thermal.c
+++ b/arch/powerpc/platforms/cell/cbe_thermal.c
@@ -129,9 +129,9 @@ static ssize_t store_throttle(struct cbe_pmd_regs __iomem *pmd_regs, const char
u64 new_value;
int ret;
- ret = sscanf(buf, "%u", &temp);
+ ret = kstrtouint(buf, 0, &temp);
- if (ret != 1 || temp < TEMP_MIN || temp > TEMP_MAX)
+ if (ret || temp < TEMP_MIN || temp > TEMP_MAX)
return -EINVAL;
new_value = temp_to_reg(temp);
--
1.9.1
More information about the Linuxppc-dev
mailing list