Skip to contentSkip to conversation

pxa2xx_spi buildfix

PATCH In review David Brownell 2 participants 2 messages Sep 23, 2008 1 message not in the archive SPI

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 pxa2xx_spi buildfix

From: Mike Rapoport <mike-UTxiZqZC01RS1MOuV/[email protected]>

This patch fixes a build error in the pxa2xx-spi driver, introduced by commit 7e96445533ac3f4f7964646a202ff3620602fab4

[[email protected]: fix sparse warning too ]

---
for 2.6.27-final, please ...

 drivers/spi/pxa2xx_spi.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/spi/pxa2xx_spi.c +2 -2
@@ -49,7 +49,7 @@ MODULE_ALIAS("platform:pxa2xx-spi");
 
 #define DMA_INT_MASK		(DCSR_ENDINTR | DCSR_STARTINTR | DCSR_BUSERR)
 #define RESET_DMA_CHANNEL	(DCSR_NODESC | DMA_INT_MASK)
-#define IS_DMA_ALIGNED(x)	(((x) & 0x07) == 0)
+#define IS_DMA_ALIGNED(x)	((((u32)(x)) & 0x07) == 0)
 #define MAX_DMA_LEN		8191
 
 /*
@@ -896,7 +896,7 @@ static void pump_transfers(unsigned long
 				|| transfer->rx_dma || transfer->tx_dma) {
 			dev_err(&drv_data->pdev->dev,
 				"pump_transfers: mapped transfer length "
-				"of %lu is greater than %d\n",
+				"of %u is greater than %d\n",
 				transfer->len, MAX_DMA_LEN);
 			message->status = -EINVAL;
 			giveback(drv_data);

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/

A message that is not in the archive (sent off-list or not yet received): 200809230056.25075.david-b-yBeKhBN/[email protected]

#2 lore raw
Quoted 4 lines · On Tue, 23 Sep 2008 00:56:24 -0700 David Brownell…

From: Mike Rapoport <mike-UTxiZqZC01RS1MOuV/[email protected]>

This patch fixes a build error in the pxa2xx-spi driver, introduced by commit 7e96445533ac3f4f7964646a202ff3620602fab4

Please always include the title of the commit as well as it's ID. otherwise Linus chucks a wobbly. I always have to look it up and fill it in.

Quoted 7 lines

[[email protected]: fix sparse warning too ]

---
for 2.6.27-final, please ...

Please always quote the compiler output when fixing build errors and warnings.

drivers/spi/pxa2xx_spi.c MODULE_ALIAS("platform:pxa2xx-spi"); · line 53

Quoted 12 lines
 drivers/spi/pxa2xx_spi.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/spi/pxa2xx_spi.c +1 -1
@@ -49,7 +49,7 @@ MODULE_ALIAS("platform:pxa2xx-spi");
 
 #define DMA_INT_MASK		(DCSR_ENDINTR | DCSR_STARTINTR | DCSR_BUSERR)
 #define RESET_DMA_CHANNEL	(DCSR_NODESC | DMA_INT_MASK)
-#define IS_DMA_ALIGNED(x)	(((x) & 0x07) == 0)
+#define IS_DMA_ALIGNED(x)	((((u32)(x)) & 0x07) == 0)
 #define MAX_DMA_LEN		8191

I assume we were passing this a pointer?

include/linux/kernel.h has ALIGN and PTR_ALIGN, and IS_ALIGNED, but no IS_PTR_ALIGNED.

drivers/spi/pxa2xx_spi.c static void pump_transfers(unsigned long · line 902

Quoted 10 lines
drivers/spi/pxa2xx_spi.c +1 -1
 /*
@@ -896,7 +896,7 @@ static void pump_transfers(unsigned long
 				|| transfer->rx_dma || transfer->tx_dma) {
 			dev_err(&drv_data->pdev->dev,
 				"pump_transfers: mapped transfer length "
-				"of %lu is greater than %d\n",
+				"of %u is greater than %d\n",
 				transfer->len, MAX_DMA_LEN);
 			message->status = -EINVAL;
 			giveback(drv_data);

OK, that one's pretty obvious.

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/