summaryrefslogtreecommitdiffstats
path: root/drivers/staging/comedi/comedi_fops.c
diff options
context:
space:
mode:
authorIan Abbott2015-10-12 18:21:23 +0200
committerGreg Kroah-Hartman2015-10-13 19:29:48 +0200
commit76e8e7d4ffb3300217b62637183282a5225d7394 (patch)
tree456554788fe1fdec14a890a0df152877cf0db5c1 /drivers/staging/comedi/comedi_fops.c
parentstaging: comedi: do extra checks for becoming non-busy for "read" (diff)
downloadkernel-qcow2-linux-76e8e7d4ffb3300217b62637183282a5225d7394.tar.gz
kernel-qcow2-linux-76e8e7d4ffb3300217b62637183282a5225d7394.tar.xz
kernel-qcow2-linux-76e8e7d4ffb3300217b62637183282a5225d7394.zip
staging: comedi: make some variables unsigned in comedi_read()
In `comedi_read()`, the `n` and `m` variables are of type `int`. Change them to `unsigned int` as they are used to measure a positive number of bytes. The `count` variable is also of type `int` and holds the returned number of bytes. Change it to type `ssize_t` to match the function's return type. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/comedi/comedi_fops.c')
-rw-r--r--drivers/staging/comedi/comedi_fops.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/staging/comedi/comedi_fops.c b/drivers/staging/comedi/comedi_fops.c
index 49c46651ad23..92f571645f36 100644
--- a/drivers/staging/comedi/comedi_fops.c
+++ b/drivers/staging/comedi/comedi_fops.c
@@ -2450,7 +2450,9 @@ static ssize_t comedi_read(struct file *file, char __user *buf, size_t nbytes,
{
struct comedi_subdevice *s;
struct comedi_async *async;
- int n, m, count = 0, retval = 0;
+ unsigned int n, m;
+ ssize_t count = 0;
+ int retval = 0;
DECLARE_WAITQUEUE(wait, current);
struct comedi_file *cfp = file->private_data;
struct comedi_device *dev = cfp->dev;