linux-sg2042/include/linux/spi
Stephen Warren 4dd9572abc spi: fix undefined behaviour in SPI_BPW_RANGE_MASK
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>
2013-06-01 19:46:16 +01:00
..
74x164.h
ad7877.h
ad7879.h Input: ad7879 - add option to correct xy axis 2012-07-06 19:12:26 -07:00
ads7846.h Input: ads7846 - enable pendown GPIO debounce time setting 2012-11-21 13:09:56 -08:00
at73c213.h
at86rf230.h at86rf230: add irq type configuration option 2013-04-16 16:34:07 -04:00
corgi_lcd.h
ds1305.h
eeprom.h Support M95040 SPI EEPROM 2012-04-18 14:57:57 -07:00
flash.h
ifx_modem.h
l4f00242t03.h
libertas_spi.h
lms283gf05.h
max7301.h
mc33880.h
mcp23s08.h
mmc_spi.h
mxs-spi.h spi: mxs-spi: move to use generic DMA helper 2013-04-04 21:22:44 +08:00
pxa2xx_spi.h spi/pxa2xx: add support for Intel Low Power Subsystem SPI 2013-02-08 13:14:40 +00:00
rspi.h spi/rspi: add dmaengine support 2012-05-19 22:37:16 -06:00
s3c24xx.h
sh_hspi.h
sh_msiof.h
spi.h spi: fix undefined behaviour in SPI_BPW_RANGE_MASK 2013-06-01 19:46:16 +01:00
spi_bitbang.h
spi_gpio.h spi: spi-gpio: fix compilation warning on 64 bits systems 2013-01-31 18:25:44 +08:00
spi_oc_tiny.h
tdo24m.h
tle62x0.h
tsc2005.h spi: tsc2005: delete soon-obsolete e-mail address 2012-10-17 16:32:46 +09:00
xilinx_spi.h