Skip to contentSkip to conversation

Documentation/spi/* compile warning fix

PATCH Prarit Bhargava 2 participants 3 messages May 19, 2010 2 messages not in the archive SPI

lore
Share & tools
lore
#0 lore raw

Fix this warning:

Documentation/spi/spidev_fdx.c: In function `do_msg':
Documentation/spi/spidev_fdx.c:61: warning: cast from pointer to integer of different size Documentation/spi/spidev_fdx.c:64: warning: cast from pointer to integer of different size

buf should be unsigned long to match native arch on 32-bit x86 compile.

Documentation/spi/spidev_fdx.c +2 -2
index fc354f7..36ec077 100644
@@ -58,10 +58,10 @@ static void do_msg(int fd, int len)
 		len = sizeof buf;
 
 	buf[0] = 0xaa;
-	xfer[0].tx_buf = (__u64) buf;
+	xfer[0].tx_buf = (unsigned long)buf;
 	xfer[0].len = 1;
 
-	xfer[1].rx_buf = (__u64) buf;
+	xfer[1].rx_buf = (unsigned long) buf;
 	xfer[1].len = len;
 
 	status = ioctl(fd, SPI_IOC_MESSAGE(2), xfer);

------------------------------------------------------------------------------

A message that is not in the archive (sent off-list or not yet received): 20100519175712.10378.62717.sendpatchset-lwyPSKVeczd+7Tl7ptjsKdvLeJWuRmrY@public.gmane.org

#2 lore raw

Sorry everyone ... I left off [PATCH]: ... will resend shortly.

(And then I top-posted too...)

P.

Quoted 18 lines · Prarit Bhargava

Fix this warning:

Documentation/spi/spidev_fdx.c: In function `do_msg':
Documentation/spi/spidev_fdx.c:61: warning: cast from pointer to integer of different size Documentation/spi/spidev_fdx.c:64: warning: cast from pointer to integer of different size

buf should be unsigned long to match native arch on 32-bit x86 compile.

Documentation/spi/spidev_fdx.c +0 -0
index fc354f7..36ec077 100644
@@ -58,10 +58,10 @@ static void do_msg(int fd, int len)
  		len = sizeof buf;
 

Documentation/spi/spidev_fdx.c static void do_msg(int fd, int len) · line 67

Quoted 10 lines
Documentation/spi/spidev_fdx.c +2 -2
  	buf[0] = 0xaa;
-	xfer[0].tx_buf = (__u64) buf;
+	xfer[0].tx_buf = (unsigned long)buf;
  	xfer[0].len = 1;
 
-	xfer[1].rx_buf = (__u64) buf;
+	xfer[1].rx_buf = (unsigned long) buf;
  	xfer[1].len = len;
 
  	status = ioctl(fd, SPI_IOC_MESSAGE(2), xfer);

------------------------------------------------------------------------------

A message that is not in the archive (sent off-list or not yet received): [email protected]

#4 lore raw
Quoted 3 lines · Prarit Bhargava

Sorry everyone ... I left off [PATCH]: ... will resend shortly.

(And then I top-posted too...)

[PATCH] is trivial and unnecessary. As long as it shows up in patchwork, then I won't forget about it:

https://patchwork.kernel.org/patch/100984/

(It may take me a while to pick it up, but I won't forget about it).

g.

------------------------------------------------------------------------------