[bug report] iio: imu: Add support for the ADIS16460 IMU

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello Alexandru Ardelean,

The patch db6ed4d23dd1: "iio: imu: Add support for the ADIS16460 IMU"
from Jul 23, 2019, leads to the following static checker warning:

	drivers/iio/imu/adis16460.c:158 adis16460_set_freq()
	warn: 't' unsigned <= 0

drivers/iio/imu/adis16460.c
   152  static int adis16460_set_freq(struct iio_dev *indio_dev, int val, int val2)
   153  {
   154          struct adis16460 *st = iio_priv(indio_dev);
   155          unsigned int t;
                ^^^^^^^^^^^^^^

   156  
   157          t =  val * 1000 + val2 / 1000;
   158          if (t <= 0)
                    ^^^^^^
Unsigned is not less than zero.

   159                  return -EINVAL;
   160  
   161          t = 2048000 / t;
   162          if (t > 2048)
   163                  t = 2048;
   164  
   165          if (t != 0)
   166                  t--;
   167  
   168          return adis_write_reg_16(&st->adis, ADIS16460_REG_DEC_RATE, t);
   169  }

regards,
dan carpenter



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Input]     [Linux Kernel]     [Linux SCSI]     [X.org]

  Powered by Linux