public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
* [linux-dvb] [PATCH] saa716x: don't cast pointers to 32bit int
@ 2009-01-05 17:09 Luca Tettamanti
  2009-01-27 23:51 ` Manu Abraham
  0 siblings, 1 reply; 3+ messages in thread
From: Luca Tettamanti @ 2009-01-05 17:09 UTC (permalink / raw)
  To: linux-dvb; +Cc: Manu Abraham

Pointers may be 64bit long, casting them to u32 is wrong.
For doing math on the address unsigned long is guaranteed to have to correct
size to hold the value of the pointer.

Signed-off-by: Luca Tettamanti <kronos.it@gmail.com>
---
 Patch applies to HG repo.

 linux/drivers/media/dvb/saa716x/saa716x_dma.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Index: saa716x/linux/drivers/media/dvb/saa716x/saa716x_dma.c
===================================================================
--- saa716x.orig/linux/drivers/media/dvb/saa716x/saa716x_dma.c	2008-12-27 21:35:04.000000000 +0100
+++ saa716x/linux/drivers/media/dvb/saa716x/saa716x_dma.c	2008-12-27 21:35:28.000000000 +0100
@@ -34,7 +34,7 @@
 		return -ENOMEM;
 	}
 
-	BUG_ON(!(((u32) dmabuf->mem_ptab_phys % SAA716x_PAGE_SIZE) == 0));
+	BUG_ON(!(((unsigned long) dmabuf->mem_ptab_phys % SAA716x_PAGE_SIZE) == 0));
 
 	return 0;
 }
@@ -126,9 +126,9 @@
 		}
 
 		/* align memory to page */
-		dmabuf->mem_virt = (void *) PAGE_ALIGN (((u32) dmabuf->mem_virt_noalign));
+		dmabuf->mem_virt = (void *) PAGE_ALIGN (((unsigned long) dmabuf->mem_virt_noalign));
 
-		BUG_ON(!((((u32) dmabuf->mem_virt) % SAA716x_PAGE_SIZE) == 0));
+		BUG_ON(!((((unsigned long) dmabuf->mem_virt) % SAA716x_PAGE_SIZE) == 0));
 	} else {
 		dmabuf->mem_virt = buf;
 	}

Luca
-- 
Porc i' mond che cio' sott i piedi!
V. Catozzo

_______________________________________________
linux-dvb mailing list
linux-dvb@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb

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

end of thread, other threads:[~2009-01-30  9:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-05 17:09 [linux-dvb] [PATCH] saa716x: don't cast pointers to 32bit int Luca Tettamanti
2009-01-27 23:51 ` Manu Abraham
2009-01-30  9:47   ` [linux-dvb] saa716x: HC82 does not work Martin Pauly

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