diff mbox

spi: fix pointer-integer size mismatch warning

Message ID 1391497089-6831-1-git-send-email-sj38.park@gmail.com (mailing list archive)
State Accepted
Commit e1bde3b11fedace5042f0232339da90bc85666af
Headers show

Commit Message

SeongJae Park Feb. 4, 2014, 6:58 a.m. UTC
Fix the pointer-integer size mismatch warning below:
	drivers/spi/spi-gpio.c: In function ‘spi_gpio_setup’:
	drivers/spi/spi-gpio.c:252:8: warning: cast from pointer to integer of
			different size [-Wpointer-to-int-cast]
	   cs = (unsigned int) spi->controller_data;
	        ^

Signed-off-by: SeongJae Park <sj38.park@gmail.com>
---
 drivers/spi/spi-gpio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Mark Brown Feb. 4, 2014, 11:17 a.m. UTC | #1
On Tue, Feb 04, 2014 at 03:58:09PM +0900, SeongJae Park wrote:
> Fix the pointer-integer size mismatch warning below:
> 	drivers/spi/spi-gpio.c: In function ‘spi_gpio_setup’:
> 	drivers/spi/spi-gpio.c:252:8: warning: cast from pointer to integer of
> 			different size [-Wpointer-to-int-cast]
> 	   cs = (unsigned int) spi->controller_data;
> 	        ^

Applied, thanks.
diff mbox

Patch

diff --git a/drivers/spi/spi-gpio.c b/drivers/spi/spi-gpio.c
index cfc9fb3..406bbd7 100644
--- a/drivers/spi/spi-gpio.c
+++ b/drivers/spi/spi-gpio.c
@@ -249,7 +249,7 @@  static int spi_gpio_setup(struct spi_device *spi)
 		/*
 		 * ... otherwise, take it from spi->controller_data
 		 */
-		cs = (unsigned int) spi->controller_data;
+		cs = (unsigned int)(uintptr_t) spi->controller_data;
 	}
 
 	if (!spi->controller_state) {