Linux IIO development
 help / color / mirror / Atom feed
* [PATCH][next] iio: addac: ad74115: remove redundant if statement
@ 2024-03-28 11:22 Colin Ian King
  2024-03-28 13:52 ` Nuno Sá
  0 siblings, 1 reply; 4+ messages in thread
From: Colin Ian King @ 2024-03-28 11:22 UTC (permalink / raw)
  To: Lars-Peter Clausen, Michael Hennerich, Cosmin Tanislav,
	Jonathan Cameron, linux-iio
  Cc: kernel-janitors, linux-kernel

The if statement is redundant because the variable i being
assigned in the statement is never read afterwards. Remove it.

Cleans up clang scan build warning:
drivers/iio/addac/ad74115.c:570:3: warning: Value stored to 'i'
is never read [deadcode.DeadStores]

Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
---
 drivers/iio/addac/ad74115.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/iio/addac/ad74115.c b/drivers/iio/addac/ad74115.c
index e6bc5eb3788d..d31d4adb017e 100644
--- a/drivers/iio/addac/ad74115.c
+++ b/drivers/iio/addac/ad74115.c
@@ -566,9 +566,6 @@ static int ad74115_set_comp_debounce(struct ad74115_state *st, unsigned int val)
 		if (val <= ad74115_debounce_tbl[i])
 			break;
 
-	if (i == len)
-		i = len - 1;
-
 	return regmap_update_bits(st->regmap, AD74115_DIN_CONFIG1_REG,
 				  AD74115_DIN_DEBOUNCE_MASK,
 				  FIELD_PREP(AD74115_DIN_DEBOUNCE_MASK, val));
-- 
2.39.2


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-03-28 15:56 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-28 11:22 [PATCH][next] iio: addac: ad74115: remove redundant if statement Colin Ian King
2024-03-28 13:52 ` Nuno Sá
2024-03-28 14:14   ` Dan Carpenter
2024-03-28 15:56     ` Nuno Sá

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox