iio: st_accel: remove redundant unsigned less than zero check
authorColin Ian King <colin.king@canonical.com>
Thu, 21 Feb 2019 10:46:36 +0000 (10:46 +0000)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Thu, 4 Apr 2019 19:19:50 +0000 (20:19 +0100)
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>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/accel/st_accel_core.c

index a3c0916..9930edf 100644 (file)
@@ -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