[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1405164980-9525-5-git-send-email-fabf@skynet.be>
Date: Sat, 12 Jul 2014 13:36:17 +0200
From: Fabian Frederick <fabf@...net.be>
To: linux-kernel@...r.kernel.org
Cc: paulus@...ba.org, benh@...nel.crashing.org,
linuxppc-dev@...ts.ozlabs.org, Fabian Frederick <fabf@...net.be>
Subject: [PATCH 4/7] powerpc/sysfs: replace sscanf by kstrtol
See checkpatch warning
"Prefer kstrto<type> to single variable sscanf"
Signed-off-by: Fabian Frederick <fabf@...net.be>
---
arch/powerpc/kernel/sysfs.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/arch/powerpc/kernel/sysfs.c b/arch/powerpc/kernel/sysfs.c
index 67fd2fd..4293e4f 100644
--- a/arch/powerpc/kernel/sysfs.c
+++ b/arch/powerpc/kernel/sysfs.c
@@ -43,12 +43,11 @@ static ssize_t store_smt_snooze_delay(struct device *dev,
size_t count)
{
struct cpu *cpu = container_of(dev, struct cpu, dev);
- ssize_t ret;
long snooze;
+ int rc = kstrtol(buf, 0, &snooze);
- ret = sscanf(buf, "%ld", &snooze);
- if (ret != 1)
- return -EINVAL;
+ if (rc)
+ return rc;
per_cpu(smt_snooze_delay, cpu->dev.id) = snooze;
return count;
--
1.9.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists