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


Groups > linux.kernel > #1517045

[PATCH v2 12/23] staging: iio: tsl2583: fix comparison between signed and unsigned integers

From Brian Masney <masneyb@onstation.org>
Newsgroups linux.kernel
Subject [PATCH v2 12/23] staging: iio: tsl2583: fix comparison between signed and unsigned integers
Date 2016-11-08 11:30 +0100
Message-ID <sBbPb-88c-7@gated-at.bofh.it> (permalink)
References <sBbFv-84M-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Fixed warning found by make W=2:

warning: comparison between signed and unsigned integer expressions
[-Wsign-compare]

Signed-off-by: Brian Masney <masneyb@onstation.org>
---
 drivers/staging/iio/light/tsl2583.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/iio/light/tsl2583.c b/drivers/staging/iio/light/tsl2583.c
index ad6866a..8be135b 100644
--- a/drivers/staging/iio/light/tsl2583.c
+++ b/drivers/staging/iio/light/tsl2583.c
@@ -506,7 +506,7 @@ static ssize_t in_illuminance_lux_table_show(struct device *dev,
 					     struct device_attribute *attr,
 					     char *buf)
 {
-	int i;
+	unsigned int i;
 	int offset = 0;
 
 	for (i = 0; i < ARRAY_SIZE(tsl2583_device_lux); i++) {
@@ -537,7 +537,8 @@ static ssize_t in_illuminance_lux_table_store(struct device *dev,
 	struct iio_dev *indio_dev = dev_to_iio_dev(dev);
 	struct tsl2583_chip *chip = iio_priv(indio_dev);
 	int value[ARRAY_SIZE(tsl2583_device_lux) * 3 + 1];
-	int n, ret = -EINVAL;
+	int ret = -EINVAL;
+	unsigned int n;
 
 	mutex_lock(&chip->als_mutex);
 
@@ -715,7 +716,7 @@ static int tsl2583_write_raw(struct iio_dev *indio_dev,
 		break;
 	case IIO_CHAN_INFO_CALIBSCALE:
 		if (chan->type == IIO_LIGHT) {
-			int i;
+			unsigned int i;
 
 			for (i = 0; i < ARRAY_SIZE(gainadj); i++) {
 				if (gainadj[i].mean == val) {
-- 
2.7.4

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v2 00/23] staging: iio: tsl2583: move out of staging Brian Masney <masneyb@onstation.org> - 2016-11-08 11:20 +0100
  [PATCH v2 02/23] staging: iio: tsl2583: fix issue with changes to calibscale and int_time not being set on the chip Brian Masney <masneyb@onstation.org> - 2016-11-08 11:20 +0100
  [PATCH v2 09/23] staging: iio: tsl2583: cleaned up logging Brian Masney <masneyb@onstation.org> - 2016-11-08 11:20 +0100
    Re: [PATCH v2 09/23] staging: iio: tsl2583: cleaned up logging Joe Perches <joe@perches.com> - 2016-11-08 11:30 +0100
      Re: [PATCH v2 09/23] staging: iio: tsl2583: cleaned up logging Brian Masney <masneyb@onstation.org> - 2016-11-08 17:00 +0100
  [PATCH v2 03/23] staging: iio: tsl2583: check if chip is suspended in in_illuminance_calibrate_store Brian Masney <masneyb@onstation.org> - 2016-11-08 11:20 +0100
  [PATCH v2 15/23] staging: iio: tsl2583: fix multiline comment syntax Brian Masney <masneyb@onstation.org> - 2016-11-08 11:30 +0100
  [PATCH v2 12/23] staging: iio: tsl2583: fix comparison between signed and unsigned integers Brian Masney <masneyb@onstation.org> - 2016-11-08 11:30 +0100
  [PATCH v2 18/23] staging: iio: tsl2583: change tsl2583_als_calibrate() to return 0 on success Brian Masney <masneyb@onstation.org> - 2016-11-08 11:30 +0100
  [PATCH v2 20/23] staging: iio: tsl2583: don't assume an unsigned int is 32 bits Brian Masney <masneyb@onstation.org> - 2016-11-08 11:30 +0100
  [PATCH v2 22/23] staging: iio: tsl2583: updated copyright and MODULE_AUTHOR Brian Masney <masneyb@onstation.org> - 2016-11-08 11:30 +0100
    Re: [PATCH v2 22/23] staging: iio: tsl2583: updated copyright and  MODULE_AUTHOR Jonathan Cameron <jic23@kernel.org> - 2016-11-08 21:50 +0100
  [PATCH v2 19/23] staging: iio: tsl2583: remove unnecessary parentheses Brian Masney <masneyb@onstation.org> - 2016-11-08 11:30 +0100
  [PATCH v2 14/23] staging: iio: tsl2583: combine sysfs documentation Brian Masney <masneyb@onstation.org> - 2016-11-08 11:30 +0100
  [PATCH v2 16/23] staging: iio: tsl2583: updated code comment to match what the code does Brian Masney <masneyb@onstation.org> - 2016-11-08 11:30 +0100
  [PATCH v2 11/23] staging: iio: tsl2583: fix alignment of #define values Brian Masney <masneyb@onstation.org> - 2016-11-08 11:30 +0100
  [PATCH v2 17/23] staging: iio: tsl2583: moved code block inside else statement Brian Masney <masneyb@onstation.org> - 2016-11-08 11:40 +0100
  [PATCH v2 21/23] staging: iio: tsl2583: move from a global to a per device lux table Brian Masney <masneyb@onstation.org> - 2016-11-08 11:40 +0100
  [PATCH v2 13/23] staging: iio: tsl2583: change newlines to improve readability Brian Masney <masneyb@onstation.org> - 2016-11-08 11:40 +0100

csiph-web