Re: [PATCH v2] comedi_fops: Replace deprecated strict_strtoul with kstrtouint

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

 



On Tue, Dec 06, 2011 at 11:08:08AM +0100, Florian Schmaus wrote:
> As reported by checkpatch.pl strict_strtoul should be replaced. It was replaced with kstrtouint since async->max_bufsize is an unsigned int anyway.
> 
> Signed-off-by: Florian Schmaus <fschmaus@xxxxxxxxx>
> ---
>  drivers/staging/comedi/comedi_fops.c |   34 +++++++++++++++++++++-------------
>  1 files changed, 21 insertions(+), 13 deletions(-)
> 
> diff --git a/drivers/staging/comedi/comedi_fops.c b/drivers/staging/comedi/comedi_fops.c
> index 21d8c1c..220f24f 100644
> --- a/drivers/staging/comedi/comedi_fops.c
> +++ b/drivers/staging/comedi/comedi_fops.c
> @@ -2429,13 +2429,15 @@ static ssize_t store_max_read_buffer_kb(struct device *dev,
>  					const char *buf, size_t count)
>  {
>  	struct comedi_device_file_info *info = dev_get_drvdata(dev);
> -	unsigned long new_max_size_kb;
> +	unsigned int new_max_size_kb;
>  	uint64_t new_max_size;
> +	int ret;
>  	struct comedi_subdevice *const read_subdevice =
>  	    comedi_get_read_subdevice(info);
> -
> -	if (strict_strtoul(buf, 10, &new_max_size_kb))
> -		return -EINVAL;
> + 
> +	ret = kstrtouint(buf, 10, &new_max_size_kb);
> +	if (ret)
> +		return ret;
>  	if (new_max_size_kb != (uint32_t) new_max_size_kb)
>  		return -EINVAL;

You could remove this check, because it's always true now with your
modification.  The same for all the rest.

regards,
dan carpenter

Attachment: signature.asc
Description: Digital signature

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/devel

[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux