Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 281327
b: refs/heads/master
c: 2e1c394
h: refs/heads/master
i:
  281325: 258e43d
  281323: 8477c6b
  281319: 85fa394
  281311: ceabfdb
v: v3
  • Loading branch information
Florian Schmaus authored and Greg Kroah-Hartman committed Dec 8, 2011
1 parent 527e5c6 commit 5b2e834
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 13 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 877a0893e3751022d2e60bea54dd5ac2e4026997
refs/heads/master: 2e1c394fc398afb75d89c53f933149d33dc9e280
32 changes: 20 additions & 12 deletions trunk/drivers/staging/comedi/comedi_fops.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 5b2e834

Please sign in to comment.