summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorFlorian Schmaus <fschmaus@gmail.com>2011-12-08 12:12:44 +0100
committerGreg Kroah-Hartman <gregkh@suse.de>2011-12-08 15:59:08 -0800
commit2e1c394fc398afb75d89c53f933149d33dc9e280 (patch)
treef57b45808746d29ff604cab39b88198f14674a02 /drivers
parent877a0893e3751022d2e60bea54dd5ac2e4026997 (diff)
staging: comedi: comedi_fops: Replace deprecated strict_strtoul with kstrtouint
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@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/staging/comedi/comedi_fops.c32
1 files changed, 20 insertions, 12 deletions
diff --git a/drivers/staging/comedi/comedi_fops.c b/drivers/staging/comedi/comedi_fops.c
index 21d8c1c16cd8..60200b46be0b 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;
new_max_size = ((uint64_t) new_max_size_kb) * bytes_per_kibi;
@@ -2490,14 +2492,16 @@ static ssize_t store_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_size_kb;
+ unsigned int new_size_kb;
uint64_t new_size;
int retval;
+ int ret;
struct comedi_subdevice *const read_subdevice =
comedi_get_read_subdevice(info);
- if (strict_strtoul(buf, 10, &new_size_kb))
- return -EINVAL;
+ ret = kstrtouint(buf, 10, &new_size_kb);
+ if (ret)
+ return ret;
if (new_size_kb != (uint32_t) new_size_kb)
return -EINVAL;
new_size = ((uint64_t) new_size_kb) * bytes_per_kibi;
@@ -2556,13 +2560,15 @@ static ssize_t store_max_write_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 write_subdevice =
comedi_get_write_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;
new_max_size = ((uint64_t) new_max_size_kb) * bytes_per_kibi;
@@ -2617,14 +2623,16 @@ static ssize_t store_write_buffer_kb(struct device *dev,
const char *buf, size_t count)
{
struct comedi_device_file_info *info = dev_get_drvdata(dev);
- unsigned long new_size_kb;
+ unsigned int new_size_kb;
uint64_t new_size;
int retval;
+ int ret;
struct comedi_subdevice *const write_subdevice =
comedi_get_write_subdevice(info);
- if (strict_strtoul(buf, 10, &new_size_kb))
- return -EINVAL;
+ ret = kstrtouint(buf, 10, &new_size_kb);
+ if (ret)
+ return ret;
if (new_size_kb != (uint32_t) new_size_kb)
return -EINVAL;
new_size = ((uint64_t) new_size_kb) * bytes_per_kibi;