[PATCH 6/7] powerpc/cell: replace sscanf by kstrtouint

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


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

Signed-off-by: Fabian Frederick <fabf@xxxxxxxxx>
---
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

--
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/