lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230327120823.1369700-1-trix@redhat.com>
Date:   Mon, 27 Mar 2023 08:08:23 -0400
From:   Tom Rix <trix@...hat.com>
To:     jic23@...nel.org, lars@...afoo.de, nathan@...nel.org,
        ndesaulniers@...gle.com, andriy.shevchenko@...ux.intel.com,
        u.kleine-koenig@...gutronix.de
Cc:     linux-iio@...r.kernel.org, linux-kernel@...r.kernel.org,
        llvm@...ts.linux.dev, Tom Rix <trix@...hat.com>
Subject: [PATCH] iio: tsl2772: remove unused prox_diode_mask variable

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@...hat.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ