[PATCH] Replace a single-value sscanf() call with a call to kstrtou32(), as recommended by checkpatch.pl.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Lars R. Damerow <lars@xxxxxxxxxxxxxx>
---
 drivers/staging/usbip/vhci_sysfs.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/usbip/vhci_sysfs.c b/drivers/staging/usbip/vhci_sysfs.c
index 211f43f..b3371d0 100644
--- a/drivers/staging/usbip/vhci_sysfs.c
+++ b/drivers/staging/usbip/vhci_sysfs.c
@@ -114,8 +114,9 @@ static ssize_t store_detach(struct device *dev, struct device_attribute *attr,
 	int err;
 	__u32 rhport = 0;
 
-	if (sscanf(buf, "%u", &rhport) != 1)
-		return -EINVAL;
+	err = kstrtou32(buf, 10, &rhport);
+	if (err < 0)
+		return err;
 
 	/* check rhport */
 	if (rhport >= VHCI_NPORTS) {
-- 
1.9.3

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux