Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1272413 > unrolled thread

[PATCH 3/8] staging: comedi: make some variables unsigned in comedi_write()

Started byIan Abbott <abbotti@mev.co.uk>
First post2015-11-18 19:00 +0100
Last post2015-11-18 19:00 +0100
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 3/8] staging: comedi: make some variables unsigned in comedi_write() Ian Abbott <abbotti@mev.co.uk> - 2015-11-18 19:00 +0100

#1272413 — [PATCH 3/8] staging: comedi: make some variables unsigned in comedi_write()

FromIan Abbott <abbotti@mev.co.uk>
Date2015-11-18 19:00 +0100
Subject[PATCH 3/8] staging: comedi: make some variables unsigned in comedi_write()
Message-ID<qwfbs-6aN-5@gated-at.bofh.it>
In `comedi_write()`, 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 written.  Change it to type `ssize_t` to
match the function's return type.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
---
 drivers/staging/comedi/comedi_fops.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/comedi/comedi_fops.c b/drivers/staging/comedi/comedi_fops.c
index 94c2348..188a12a 100644
--- a/drivers/staging/comedi/comedi_fops.c
+++ b/drivers/staging/comedi/comedi_fops.c
@@ -2303,7 +2303,9 @@ static ssize_t comedi_write(struct file *file, const char __user *buf,
 {
 	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;
-- 
2.6.2

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web