diff options
author | Stephen Warren <swarren@nvidia.com> | 2013-08-01 16:08:57 -0600 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2013-08-02 11:31:22 +0100 |
commit | b6aa23ccaea1548cfb404b41129717f13443bccf (patch) | |
tree | 9f09879e7e5483ce24403c7cf8f994907a293536 /include/linux/spi | |
parent | 5ae90d8e467e625e447000cb4335c4db973b1095 (diff) | |
download | op-kernel-dev-b6aa23ccaea1548cfb404b41129717f13443bccf.zip op-kernel-dev-b6aa23ccaea1548cfb404b41129717f13443bccf.tar.gz |
spi: fix SPI_BIT_MASK so it always fits into 32-bits
On a 64-bit platform, ~0UL fills 64-bits, which causes SPI_BIT_MASK(32)
not to fit into 32 bits. This causes a warning when the result is assigned
to a 32-bit variable. Use ~0U instead to prevent this. This fixes:
drivers/spi/spi-gpio.c: In function 'spi_gpio_probe':
drivers/spi/spi-gpio.c:446:2: warning: large integer implicitly truncated to unsigned type [-Woverflow]
Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'include/linux/spi')
-rw-r--r-- | include/linux/spi/spi.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/spi/spi.h b/include/linux/spi/spi.h index 28e440b..c920c2f 100644 --- a/include/linux/spi/spi.h +++ b/include/linux/spi/spi.h @@ -309,7 +309,7 @@ struct spi_master { /* bitmask of supported bits_per_word for transfers */ u32 bits_per_word_mask; #define SPI_BPW_MASK(bits) BIT((bits) - 1) -#define SPI_BIT_MASK(bits) (((bits) == 32) ? ~0UL : (BIT(bits) - 1)) +#define SPI_BIT_MASK(bits) (((bits) == 32) ? ~0U : (BIT(bits) - 1)) #define SPI_BPW_RANGE_MASK(min, max) (SPI_BIT_MASK(max) - SPI_BIT_MASK(min - 1)) /* other constraints relevant to this driver */ |