public inbox for kernel-janitors@vger.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Jonathan Cameron <jic23@kernel.org>
Cc: Lars-Peter Clausen <lars@metafoo.de>,
	Joe Sandom <joe.g.sandom@gmail.com>,
	Andy Shevchenko <andy.shevchenko@gmail.com>,
	linux-iio@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: [PATCH 1/2] iio: light: tsl2591: fix some signedness bugs
Date: Fri, 14 May 2021 16:10:07 +0300	[thread overview]
Message-ID: <YJ52r1XZ44myD9Xx@mwanda> (raw)

These variables need to be int for the error handling to work.

Fixes: f053d4e748ce ("iio: light: Added AMS tsl2591 driver implementation")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
 drivers/iio/light/tsl2591.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/iio/light/tsl2591.c b/drivers/iio/light/tsl2591.c
index 2bdae388ff01..26e3cb6c4ff8 100644
--- a/drivers/iio/light/tsl2591.c
+++ b/drivers/iio/light/tsl2591.c
@@ -213,7 +213,7 @@ static int tsl2591_gain_to_multiplier(const u8 als_gain)
 	}
 }
 
-static u8 tsl2591_multiplier_to_gain(const u32 multiplier)
+static int tsl2591_multiplier_to_gain(const u32 multiplier)
 {
 	switch (multiplier) {
 	case TSL2591_CTRL_ALS_LOW_GAIN_MULTIPLIER:
@@ -783,8 +783,8 @@ static int tsl2591_write_raw(struct iio_dev *indio_dev,
 			     int val, int val2, long mask)
 {
 	struct tsl2591_chip *chip = iio_priv(indio_dev);
-	u32 int_time;
-	u8 gain;
+	int int_time;
+	int gain;
 	int ret;
 
 	mutex_lock(&chip->als_mutex);
-- 
2.30.2


             reply	other threads:[~2021-05-14 13:10 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-14 13:10 Dan Carpenter [this message]
2021-05-14 13:10 ` [PATCH 2/2] iio: light: tsl2591: delete a stray tab Dan Carpenter
2021-05-16  9:30 ` [PATCH 1/2] iio: light: tsl2591: fix some signedness bugs 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=YJ52r1XZ44myD9Xx@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=andy.shevchenko@gmail.com \
    --cc=jic23@kernel.org \
    --cc=joe.g.sandom@gmail.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=lars@metafoo.de \
    --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