linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: linux-iio@vger.kernel.org
Cc: Jonathan Cameron <jic23@kernel.org>,
	Dan Carpenter <dan.carpenter@oracle.com>,
	Fugang Duan <B38611@freescale.com>
Subject: [PATCH] iio:adc:vf610 ensure correct handing of interruption of wait for completion
Date: Sat,  1 Mar 2014 22:02:47 +0000	[thread overview]
Message-ID: <1393711367-2210-1-git-send-email-jic23@kernel.org> (raw)

Issue highlighted by smatch warning:

CHECK   drivers/iio/adc/vf610_adc.c
drivers/iio/adc/vf610_adc.c:466 vf610_read_raw() warn: unsigned 'ret' is never less than zero.

As wait_for_completion_interruptible_timeout can return -ERESTARTSTSYS, if
interrupted, ret must be signed.

Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Cc: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Fugang Duan <B38611@freescale.com>
---
 drivers/iio/adc/vf610_adc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iio/adc/vf610_adc.c b/drivers/iio/adc/vf610_adc.c
index 37f542e..44799eb5 100644
--- a/drivers/iio/adc/vf610_adc.c
+++ b/drivers/iio/adc/vf610_adc.c
@@ -447,7 +447,7 @@ static int vf610_read_raw(struct iio_dev *indio_dev,
 {
 	struct vf610_adc *info = iio_priv(indio_dev);
 	unsigned int hc_cfg;
-	unsigned long ret;
+	long ret;
 
 	switch (mask) {
 	case IIO_CHAN_INFO_RAW:
-- 
1.9.0

             reply	other threads:[~2014-03-01 22:02 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-01 22:02 Jonathan Cameron [this message]
2014-03-02  1:36 ` [PATCH] iio:adc:vf610 ensure correct handing of interruption of wait for completion fugang.duan
2014-03-02 21:47   ` Jonathan Cameron

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1393711367-2210-1-git-send-email-jic23@kernel.org \
    --to=jic23@kernel.org \
    --cc=B38611@freescale.com \
    --cc=dan.carpenter@oracle.com \
    --cc=linux-iio@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).