Re: [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]

 



On Sat, Aug 16, 2014 at 07:41:07PM -0400, Lars R. Damerow wrote:
> 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) {

This code just got moved around in the kernel tree, can you redo this
against 3.17-rc3 when it comes out and resend if it is still needed.

thanks,

greg k-h
--
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