Re: [PATCH resend] staging: usbip: vhci_sysfs.c: Fix a style issue

2014-08-07 Thread Sergei Shtylyov

On 08/07/2014 09:38 PM, Lars R. Damerow wrote:

   Concerning the subject: it's not resend, it's version 2.


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



Signed-off-by: Lars R. Damerow 
---


   You're supposed to describe the differences between patch versions here.


  drivers/staging/usbip/vhci_sysfs.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/usbip/vhci_sysfs.c 
b/drivers/staging/usbip/vhci_sysfs.c
index 211f43f..e8f680a 100644
--- a/drivers/staging/usbip/vhci_sysfs.c
+++ b/drivers/staging/usbip/vhci_sysfs.c
@@ -114,7 +114,7 @@ static ssize_t store_detach(struct device *dev, struct 
device_attribute *attr,
int err;
__u32 rhport = 0;

-   if (sscanf(buf, "%u", &rhport) != 1)
+   if (kstrtou32(buf, 10, &rhport) < 0)
return -EINVAL;


   It's probably better to propagate error from kstrtou32().

WBR, Sergei

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


[PATCH resend] staging: usbip: vhci_sysfs.c: Fix a style issue

2014-08-07 Thread Lars R. Damerow
Replace a single-value sscanf() call with a call to kstrtou32(), as
recommended by checkpatch.pl.

Signed-off-by: Lars R. Damerow 
---
 drivers/staging/usbip/vhci_sysfs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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

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