* [PATCH] staging: iio: ad2s1210: remove redundant assignment to variable negative
@ 2022-04-18 13:46 Colin Ian King
2022-04-24 17:39 ` Jonathan Cameron
0 siblings, 1 reply; 2+ messages in thread
From: Colin Ian King @ 2022-04-18 13:46 UTC (permalink / raw)
To: Lars-Peter Clausen, Michael Hennerich, Jonathan Cameron,
Greg Kroah-Hartman, linux-iio, linux-staging
Cc: kernel-janitors, linux-kernel, llvm
Variable negative is being assigned a value that is never read, it is
being re-assigned later. The assignment is redundant and can be removed.
Cleans up clang scan build warning:
drivers/staging/iio/resolver/ad2s1210.c:502:3: warning: Value stored
to 'negative' is never read [deadcode.DeadStores]
Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
---
drivers/staging/iio/resolver/ad2s1210.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/staging/iio/resolver/ad2s1210.c b/drivers/staging/iio/resolver/ad2s1210.c
index 74adb82f37c3..c0b2716d0511 100644
--- a/drivers/staging/iio/resolver/ad2s1210.c
+++ b/drivers/staging/iio/resolver/ad2s1210.c
@@ -499,7 +499,6 @@ static int ad2s1210_read_raw(struct iio_dev *indio_dev,
ret = IIO_VAL_INT;
break;
case IIO_ANGL_VEL:
- negative = st->rx[0] & 0x80;
vel = be16_to_cpup((__be16 *)st->rx);
vel >>= 16 - st->resolution;
if (vel & 0x8000) {
--
2.35.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] staging: iio: ad2s1210: remove redundant assignment to variable negative
2022-04-18 13:46 [PATCH] staging: iio: ad2s1210: remove redundant assignment to variable negative Colin Ian King
@ 2022-04-24 17:39 ` Jonathan Cameron
0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Cameron @ 2022-04-24 17:39 UTC (permalink / raw)
To: Colin Ian King
Cc: Lars-Peter Clausen, Michael Hennerich, Greg Kroah-Hartman,
linux-iio, linux-staging, kernel-janitors, linux-kernel, llvm
On Mon, 18 Apr 2022 14:46:03 +0100
Colin Ian King <colin.i.king@gmail.com> wrote:
> Variable negative is being assigned a value that is never read, it is
> being re-assigned later. The assignment is redundant and can be removed.
>
> Cleans up clang scan build warning:
> drivers/staging/iio/resolver/ad2s1210.c:502:3: warning: Value stored
> to 'negative' is never read [deadcode.DeadStores]
>
> Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
Seems that someone decided to match again against the endian converted
version so indeed this is pointless.
Applied to the togreg branch of iio.git and pushed out as testing for 0-day
to see if it can find anything we missed.
Thanks,
Jonathan
> ---
> drivers/staging/iio/resolver/ad2s1210.c | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/drivers/staging/iio/resolver/ad2s1210.c b/drivers/staging/iio/resolver/ad2s1210.c
> index 74adb82f37c3..c0b2716d0511 100644
> --- a/drivers/staging/iio/resolver/ad2s1210.c
> +++ b/drivers/staging/iio/resolver/ad2s1210.c
> @@ -499,7 +499,6 @@ static int ad2s1210_read_raw(struct iio_dev *indio_dev,
> ret = IIO_VAL_INT;
> break;
> case IIO_ANGL_VEL:
> - negative = st->rx[0] & 0x80;
> vel = be16_to_cpup((__be16 *)st->rx);
> vel >>= 16 - st->resolution;
> if (vel & 0x8000) {
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-04-24 17:31 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-04-18 13:46 [PATCH] staging: iio: ad2s1210: remove redundant assignment to variable negative Colin Ian King
2022-04-24 17:39 ` Jonathan Cameron
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).