lkml.org 
[lkml]   [2024]   [Mar]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
SubjectRe: [PATCH][next] iio: addac: ad74115: remove redundant if statement
From
Date
Hi Colin,

Thanks for your patch...

On Thu, 2024-03-28 at 11:22 +0000, Colin Ian King wrote:
> 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;
> -

Hmm, this change is clearly good but I think we're actually missing the proper fix in
here. I'm being lazy and not checking the datasheet and Cosmin can further comment.
But I'm fairly sure that the intent of the code is actually to use i in the call to
regmap_update_bits(). I mean if we look at the mask AD74115_DIN_DEBOUNCE_MASK and the
possible values of val...

- Nuno Sá


\
 
 \ /
  Last update: 2024-03-28 14:53    [W:0.055 / U:0.224 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site