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] [thread-next>] [day] [month] [year] [list]
Date:	Sat, 12 Jul 2014 13:36:15 +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 2/7] powerpc/mv64x60_pci: replace sscanf by kstrtou32

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

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

diff --git a/arch/powerpc/sysdev/mv64x60_pci.c b/arch/powerpc/sysdev/mv64x60_pci.c
index 330d566..ca0b29c 100644
--- a/arch/powerpc/sysdev/mv64x60_pci.c
+++ b/arch/powerpc/sysdev/mv64x60_pci.c
@@ -52,14 +52,17 @@ static ssize_t mv64x60_hs_reg_write(struct file *filp, struct kobject *kobj,
 {
 	struct pci_dev *phb;
 	u32 v;
+	int rc;
 
 	if (off > 0)
 		return 0;
 	if (count <= 0)
 		return -EINVAL;
 
-	if (sscanf(buf, "%i", &v) != 1)
-		return -EINVAL;
+	rc = kstrtou32(buf, 0, &v);
+
+	if (rc)
+		return rc;
 
 	phb = pci_get_bus_and_slot(0, PCI_DEVFN(0, 0));
 	if (!phb)
-- 
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