4dd9572abc
The parameters to SPI_BPW_RANGE_MASK() are in the range 1..32. If 32 is used as a parameter, part of the expression is "1 << 32". Since 32 is >= the size of the type in use, such a shift is undefined behaviour. Add macro SPI_BIT_MASK to Implement a special case and thus avoid undefined behaviour. Use this new macro rather than BIT() when implementing SPI_BPW_RANGE_MASK(). This fixes build warnings such as: drivers/spi/spi-gpio.c:446:2: warning: left shift count >= width of type [enabled by default] SPI_BPW_MASK() already avoids this, since its parameter is also in range 1..32, yet it only shifts by up to one less than the input parameter. Reported-by: Fengguang Wu <fengguang.wu@intel.com> Signed-off-by: Stephen Warren <swarren@nvidia.com> Signed-off-by: Mark Brown <broonie@linaro.org> |
||
---|---|---|
.. | ||
74x164.h | ||
ad7877.h | ||
ad7879.h | ||
ads7846.h | ||
at73c213.h | ||
at86rf230.h | ||
corgi_lcd.h | ||
ds1305.h | ||
eeprom.h | ||
flash.h | ||
ifx_modem.h | ||
l4f00242t03.h | ||
libertas_spi.h | ||
lms283gf05.h | ||
max7301.h | ||
mc33880.h | ||
mcp23s08.h | ||
mmc_spi.h | ||
mxs-spi.h | ||
pxa2xx_spi.h | ||
rspi.h | ||
s3c24xx.h | ||
sh_hspi.h | ||
sh_msiof.h | ||
spi.h | ||
spi_bitbang.h | ||
spi_gpio.h | ||
spi_oc_tiny.h | ||
tdo24m.h | ||
tle62x0.h | ||
tsc2005.h | ||
xilinx_spi.h |