Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

iio: adc: tsc2046: fix a warning message in tsc2046_adc_update_scan_mode()

These variables are unsigned so the condition can't be less than zero
and the warning message will never be printed.

Fixes: 9374e8f5a38d ("iio: adc: add ADC driver for the TI TSC2046 controller")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/YJ+ZuO43TnguY5vq@mwanda
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

authored by

Dan Carpenter and committed by
Jonathan Cameron
9504db57 2989df46

+1 -1
+1 -1
drivers/iio/adc/ti-tsc2046.c
··· 398 398 priv->xfer.len = size; 399 399 priv->time_per_scan_us = size * 8 * priv->time_per_bit_ns / NSEC_PER_USEC; 400 400 401 - if ((priv->scan_interval_us - priv->time_per_scan_us) < 0) 401 + if (priv->scan_interval_us > priv->time_per_scan_us) 402 402 dev_warn(&priv->spi->dev, "The scan interval (%d) is less then calculated scan time (%d)\n", 403 403 priv->scan_interval_us, priv->time_per_scan_us); 404 404