Skip to contentSkip to conversation

spi: spi-gpio: fix compilation warning on 64 bits systems

PATCH Applied Maxime Ripard 2 participants 2 messages Jan 31, 2013 SPI

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 spi: spi-gpio: fix compilation warning on 64 bits systems

SPI_GPIO_NO_MOSI and SPI_GPIO_NO_MISO flags are type casted to unsigned long, yet, they are to be stored in an unsigned int field in the spi_gpio_platform_data structure.

This leads to the following warning during compilation on 64 bits systems:
warning: large integer implicitly truncated to unsigned type [-Woverflow]

---
 include/linux/spi/spi_gpio.h |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
include/linux/spi/spi_gpio.h +2 -2
index 369b3d7..1634ce3 100644
@@ -62,8 +62,8 @@
  */
 struct spi_gpio_platform_data {
 	unsigned	sck;
-	unsigned	mosi;
-	unsigned	miso;
+	unsigned long	mosi;
+	unsigned long	miso;
 
 	u16		num_chipselect;
 };
Signature · 8 lines
1.7.10.4


------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_jan
Applied
#1 lore raw
Quoted 3 lines · Maxime Ripard

SPI_GPIO_NO_MOSI and SPI_GPIO_NO_MISO flags are type casted to unsigned long, yet, they are to be stored in an unsigned int field in the spi_gpio_platform_data structure.

Applied, thanks.