summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorBrian Masney <masneyb@onstation.org>2016-09-25 14:41:07 +0300
committerJonathan Cameron <jic23@kernel.org>2016-09-27 23:08:47 +0300
commitea908ab69e7531bcebaf42e9c0c6f0b95a04330f (patch)
tree71b99bfdbc3110eda4c6d6f08938dcb106fc4182 /drivers
parent528021fcd21fdffad83563710f1186d9b3d21718 (diff)
downloadlinux-ea908ab69e7531bcebaf42e9c0c6f0b95a04330f.tar.xz
staging: iio: isl29018: fix comparison between signed and unsigned integers
Fixes warning found by make W=2: warning: comparison between signed and unsigned integer expressions Signed-off-by: Brian Masney <masneyb@onstation.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/staging/iio/light/isl29018.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/staging/iio/light/isl29018.c b/drivers/staging/iio/light/isl29018.c
index f03122c66045..30dc1da95459 100644
--- a/drivers/staging/iio/light/isl29018.c
+++ b/drivers/staging/iio/light/isl29018.c
@@ -100,7 +100,8 @@ struct isl29018_chip {
static int isl29018_set_integration_time(struct isl29018_chip *chip,
unsigned int utime)
{
- int i, ret;
+ unsigned int i;
+ int ret;
unsigned int int_time, new_int_time;
for (i = 0; i < ARRAY_SIZE(isl29018_int_utimes[chip->type]); ++i) {
@@ -135,7 +136,8 @@ static int isl29018_set_integration_time(struct isl29018_chip *chip,
static int isl29018_set_scale(struct isl29018_chip *chip, int scale, int uscale)
{
- int i, ret;
+ unsigned int i;
+ int ret;
struct isl29018_scale new_scale;
for (i = 0; i < ARRAY_SIZE(isl29018_scales[chip->int_time]); ++i) {
@@ -271,7 +273,8 @@ static ssize_t isl29018_show_scale_available(struct device *dev,
{
struct iio_dev *indio_dev = dev_to_iio_dev(dev);
struct isl29018_chip *chip = iio_priv(indio_dev);
- int i, len = 0;
+ unsigned int i;
+ int len = 0;
for (i = 0; i < ARRAY_SIZE(isl29018_scales[chip->int_time]); ++i)
len += sprintf(buf + len, "%d.%06d ",
@@ -288,7 +291,8 @@ static ssize_t isl29018_show_int_time_available(struct device *dev,
{
struct iio_dev *indio_dev = dev_to_iio_dev(dev);
struct isl29018_chip *chip = iio_priv(indio_dev);
- int i, len = 0;
+ unsigned int i;
+ int len = 0;
for (i = 0; i < ARRAY_SIZE(isl29018_int_utimes[chip->type]); ++i)
len += sprintf(buf + len, "0.%06d ",