Thread (8 messages) flat view 8 messages, 1 author, 2014-07-12
STALE4421d

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

From: Fabian Frederick <hidden>
Date: 2014-07-12 11:36:57
Also in: lkml
Subsystem: cell broadband engine architecture, linux for powerpc (32-bit and 64-bit), the rest · Maintainers: Madhavan Srinivasan, Linus Torvalds

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

Signed-off-by: Fabian Frederick <redacted>
---
 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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help