lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Sat, 12 Jul 2014 13:36:20 +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 7/7] powerpc/pseries: replace sscanf by kstrtoul

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

Signed-off-by: Fabian Frederick <fabf@...net.be>
---
 arch/powerpc/platforms/pseries/power.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/arch/powerpc/platforms/pseries/power.c b/arch/powerpc/platforms/pseries/power.c
index 6d62662..27a3e9c 100644
--- a/arch/powerpc/platforms/pseries/power.c
+++ b/arch/powerpc/platforms/pseries/power.c
@@ -38,11 +38,10 @@ static ssize_t auto_poweron_store(struct kobject *kobj,
 				  struct kobj_attribute *attr,
 				  const char *buf, size_t n)
 {
-	int ret;
 	unsigned long ups_restart;
-	ret = sscanf(buf, "%lu", &ups_restart);
+	int ret = kstrtoul(buf, 0, &ups_restart);
 
-	if ((ret == 1) && ((ups_restart == 1) || (ups_restart == 0))){
+	if ((!ret) && ((ups_restart == 1) || (ups_restart == 0))) {
 		rtas_poweron_auto = ups_restart;
 		return n;
 	}
-- 
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