From: Tom Rix <trix@redhat.com>
To: jic23@kernel.org, lars@metafoo.de, nathan@kernel.org,
ndesaulniers@google.com, andriy.shevchenko@linux.intel.com,
u.kleine-koenig@pengutronix.de
Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org,
llvm@lists.linux.dev, Tom Rix <trix@redhat.com>
Subject: [PATCH] iio: tsl2772: remove unused prox_diode_mask variable
Date: Mon, 27 Mar 2023 08:08:23 -0400 [thread overview]
Message-ID: <20230327120823.1369700-1-trix@redhat.com> (raw)
clang with W=1 reports
drivers/iio/light/tsl2772.c:576:24: error: variable
'prox_diode_mask' set but not used [-Werror,-Wunused-but-set-variable]
int i, ret, num_leds, prox_diode_mask;
^
This variable is not used so remove it.
Signed-off-by: Tom Rix <trix@redhat.com>
---
drivers/iio/light/tsl2772.c | 9 ++-------
1 file changed, 2 insertions(+), 7 deletions(-)
diff --git a/drivers/iio/light/tsl2772.c b/drivers/iio/light/tsl2772.c
index ad50baa0202c..c090405c2358 100644
--- a/drivers/iio/light/tsl2772.c
+++ b/drivers/iio/light/tsl2772.c
@@ -573,7 +573,7 @@ static int tsl2772_read_prox_led_current(struct tsl2772_chip *chip)
static int tsl2772_read_prox_diodes(struct tsl2772_chip *chip)
{
struct device *dev = &chip->client->dev;
- int i, ret, num_leds, prox_diode_mask;
+ int i, ret, num_leds;
u32 leds[TSL2772_MAX_PROX_LEDS];
ret = device_property_count_u32(dev, "amstaos,proximity-diodes");
@@ -590,13 +590,8 @@ static int tsl2772_read_prox_diodes(struct tsl2772_chip *chip)
return ret;
}
- prox_diode_mask = 0;
for (i = 0; i < num_leds; i++) {
- if (leds[i] == 0)
- prox_diode_mask |= TSL2772_DIODE0;
- else if (leds[i] == 1)
- prox_diode_mask |= TSL2772_DIODE1;
- else {
+ if (leds[i] > 1) {
dev_err(dev, "Invalid value %d in amstaos,proximity-diodes.\n", leds[i]);
return -EINVAL;
}
--
2.27.0
next reply other threads:[~2023-03-27 12:09 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-27 12:08 Tom Rix [this message]
2023-03-27 13:07 ` [PATCH] iio: tsl2772: remove unused prox_diode_mask variable Andy Shevchenko
2023-04-01 14:20 ` Jonathan Cameron
2023-04-01 20:23 ` Brian Masney
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=20230327120823.1369700-1-trix@redhat.com \
--to=trix@redhat.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=jic23@kernel.org \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=llvm@lists.linux.dev \
--cc=nathan@kernel.org \
--cc=ndesaulniers@google.com \
--cc=u.kleine-koenig@pengutronix.de \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.