* [PATCH][next] iio: st_accel: remove redundant unsigned less than zero check
@ 2019-02-21 10:46 Colin King
2019-03-03 16:16 ` Jonathan Cameron
0 siblings, 1 reply; 2+ messages in thread
From: Colin King @ 2019-02-21 10:46 UTC (permalink / raw)
To: Jonathan Cameron, Hartmut Knaack, Lars-Peter Clausen,
Peter Meerwald-Stadler, linux-iio
Cc: kernel-janitors, linux-kernel
From: Colin Ian King <colin.king@canonical.com>
The check that variable val is less than zero is redundant since val
is an unsigned int and hence can never be less than zero. Remove it.
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
drivers/iio/accel/st_accel_core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/iio/accel/st_accel_core.c b/drivers/iio/accel/st_accel_core.c
index a3c0916479fa..9930edf423bf 100644
--- a/drivers/iio/accel/st_accel_core.c
+++ b/drivers/iio/accel/st_accel_core.c
@@ -992,7 +992,7 @@ static int apply_acpi_orientation(struct iio_dev *indio_dev,
goto out;
val = elements[i].integer.value;
- if (val < 0 || val > 2)
+ if (val > 2)
goto out;
/* Avoiding full matrix multiplication, we simply reorder the
--
2.20.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH][next] iio: st_accel: remove redundant unsigned less than zero check
2019-02-21 10:46 [PATCH][next] iio: st_accel: remove redundant unsigned less than zero check Colin King
@ 2019-03-03 16:16 ` Jonathan Cameron
0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Cameron @ 2019-03-03 16:16 UTC (permalink / raw)
To: Colin King
Cc: Hartmut Knaack, Lars-Peter Clausen, Peter Meerwald-Stadler,
linux-iio, kernel-janitors, linux-kernel
On Thu, 21 Feb 2019 10:46:36 +0000
Colin King <colin.king@canonical.com> wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> The check that variable val is less than zero is redundant since val
> is an unsigned int and hence can never be less than zero. Remove it.
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
Applied.
Thanks,
Jonathan
> ---
> drivers/iio/accel/st_accel_core.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/iio/accel/st_accel_core.c b/drivers/iio/accel/st_accel_core.c
> index a3c0916479fa..9930edf423bf 100644
> --- a/drivers/iio/accel/st_accel_core.c
> +++ b/drivers/iio/accel/st_accel_core.c
> @@ -992,7 +992,7 @@ static int apply_acpi_orientation(struct iio_dev *indio_dev,
> goto out;
>
> val = elements[i].integer.value;
> - if (val < 0 || val > 2)
> + if (val > 2)
> goto out;
>
> /* Avoiding full matrix multiplication, we simply reorder the
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-03-03 16:16 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-21 10:46 [PATCH][next] iio: st_accel: remove redundant unsigned less than zero check Colin King
2019-03-03 16:16 ` 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).