public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] spi: spi-gpio: fix compilation warning on 64 bits systems
@ 2013-01-31 10:12 Maxime Ripard
  2013-01-31 10:26 ` Mark Brown
  0 siblings, 1 reply; 2+ messages in thread
From: Maxime Ripard @ 2013-01-31 10:12 UTC (permalink / raw)
  To: Mark Brown; +Cc: Brian Lilly, Grant Likely, spi-devel-general, linux-kernel

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]

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Reported-by: Fengguang Wu <fengguang.wu@intel.com>
---
 include/linux/spi/spi_gpio.h |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/linux/spi/spi_gpio.h b/include/linux/spi/spi_gpio.h
index 369b3d7..1634ce3 100644
--- a/include/linux/spi/spi_gpio.h
+++ b/include/linux/spi/spi_gpio.h
@@ -62,8 +62,8 @@
  */
 struct spi_gpio_platform_data {
 	unsigned	sck;
-	unsigned	mosi;
-	unsigned	miso;
+	unsigned long	mosi;
+	unsigned long	miso;
 
 	u16		num_chipselect;
 };
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] spi: spi-gpio: fix compilation warning on 64 bits systems
  2013-01-31 10:12 [PATCH] spi: spi-gpio: fix compilation warning on 64 bits systems Maxime Ripard
@ 2013-01-31 10:26 ` Mark Brown
  0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2013-01-31 10:26 UTC (permalink / raw)
  To: Maxime Ripard; +Cc: Brian Lilly, Grant Likely, spi-devel-general, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 258 bytes --]

On Thu, Jan 31, 2013 at 11:12:56AM +0100, Maxime Ripard wrote:
> 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.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-01-31 10:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-31 10:12 [PATCH] spi: spi-gpio: fix compilation warning on 64 bits systems Maxime Ripard
2013-01-31 10:26 ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox