Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756393AbbKRRzb (ORCPT ); Wed, 18 Nov 2015 12:55:31 -0500 Received: from smtp113.iad3a.emailsrvr.com ([173.203.187.113]:36383 "EHLO smtp113.iad3a.emailsrvr.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932982AbbKRRz0 (ORCPT ); Wed, 18 Nov 2015 12:55:26 -0500 X-Auth-ID: abbotti@mev.co.uk X-Sender-Id: abbotti@mev.co.uk From: Ian Abbott To: driverdev-devel@linuxdriverproject.org Cc: Greg Kroah-Hartman , Ian Abbott , H Hartley Sweeten , linux-kernel@vger.kernel.org Subject: [PATCH 3/8] staging: comedi: make some variables unsigned in comedi_write() Date: Wed, 18 Nov 2015 17:55:06 +0000 Message-Id: <1447869311-21955-4-git-send-email-abbotti@mev.co.uk> X-Mailer: git-send-email 2.6.2 In-Reply-To: <1447869311-21955-1-git-send-email-abbotti@mev.co.uk> References: <1447869311-21955-1-git-send-email-abbotti@mev.co.uk> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1293 Lines: 34 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 --- 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/