kernel-fxtec-pro1x/drivers/staging/iio
Jonathan Cameron f89c2b39ce staging:iio:mxs-lradc Fix large integer implicitly truncated to unsigned warning
The change to using BIT(20) for one of the bit shifts resulted
in a constant becoming unsigned. When combined with the existing
signed constants in a couple of places, this caused possible trouble,
hence the warnings:

drivers/staging/iio/adc/mxs-lradc.c: In function ‘mxs_lradc_complete_touch_event’:
drivers/staging/iio/adc/mxs-lradc.c:325:5: warning: large integer implicitly truncated to unsigned type [-Woverflow]
     (((x) << LRADC_DELAY_TRIGGER_LRADCS_OFFSET) & \
     ^
drivers/staging/iio/adc/mxs-lradc.c:734:7: note: in expansion of macro ‘LRADC_DELAY_TRIGGER’
       LRADC_DELAY_TRIGGER(1 << TOUCHSCREEN_VCHANNEL1) |
       ^
  LD [M]  drivers/staging/iio/accel/adis16201.o
drivers/staging/iio/adc/mxs-lradc.c: In function ‘mxs_lradc_buffer_preenable’:
drivers/staging/iio/adc/mxs-lradc.c:322:42: warning: large integer implicitly truncated to unsigned type [-Woverflow]
 #define LRADC_DELAY_TRIGGER_LRADCS_MASK  (0xff << 24)
                                          ^
drivers/staging/iio/adc/mxs-lradc.c:1308:29: note: in expansion of macro ‘LRADC_DELAY_TRIGGER_LRADCS_MASK’
  mxs_lradc_reg_clear(lradc, LRADC_DELAY_TRIGGER_LRADCS_MASK |
                             ^
drivers/staging/iio/adc/mxs-lradc.c: In function ‘mxs_lradc_buffer_postdisable’:
drivers/staging/iio/adc/mxs-lradc.c:322:42: warning: large integer implicitly truncated to unsigned type [-Woverflow]
 #define LRADC_DELAY_TRIGGER_LRADCS_MASK  (0xff << 24)
                                          ^
drivers/staging/iio/adc/mxs-lradc.c:1327:29: note: in expansion of macro ‘LRADC_DELAY_TRIGGER_LRADCS_MASK’
  mxs_lradc_reg_clear(lradc, LRADC_DELAY_TRIGGER_LRADCS_MASK |

The simplest fix is to force LRADC_DELAY_TRIGGER_LRADCS_MASK to be
a shift of an unsigned 0xff rather than a signed one.

This is ugly considering it is the only constant in the driver which
is so forced, but it does deal with the issue.

Fixes: e0c961bdaf (iio: adc: mxs-lradc: Prefer using the BIT macro)
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-12-02 14:06:11 -08:00
..
accel spi: Updates for v4.4 2015-11-05 13:15:12 -08:00
adc staging:iio:mxs-lradc Fix large integer implicitly truncated to unsigned warning 2015-12-02 14:06:11 -08:00
addac spi: Updates for v4.4 2015-11-05 13:15:12 -08:00
cdc staging: iio: cdc: Remove explicit comparisons 2015-10-24 19:32:09 -07:00
Documentation Staging: fixed multiple spelling errors. 2015-05-08 09:23:58 +02:00
frequency spi: Updates for v4.4 2015-11-05 13:15:12 -08:00
gyro spi: Updates for v4.4 2015-11-05 13:15:12 -08:00
impedance-analyzer Staging: iio: impedance-analyzer: Fix sparse warning 2015-10-29 07:55:17 +09:00
light staging: iio: Remove unused variable 2015-10-27 14:49:09 +09:00
magnetometer spi: Updates for v4.4 2015-11-05 13:15:12 -08:00
meter spi: Updates for v4.4 2015-11-05 13:15:12 -08:00
resolver spi: Updates for v4.4 2015-11-05 13:15:12 -08:00
trigger staging: iio: trigger: Remove explicit comparisons 2015-10-24 19:32:09 -07:00
Kconfig staging:iio: Delete some commented out lines in Kconfig and Makefile. 2015-11-21 20:14:57 +00:00
Makefile staging:iio: Delete some commented out lines in Kconfig and Makefile. 2015-11-21 20:14:57 +00:00
ring_hw.h staging: iio: Add #include guards to header files 2014-09-28 22:19:04 -04:00
TODO