lkml.org 
[lkml]   [2004]   [Feb]   [3]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
/
DateTue, 3 Feb 2004 16:28:22 -0800
From"Randy.Dunlap" <>
SubjectRe: [PATCH] meye: correct printk of dma_addr_t
On Tue, 3 Feb 2004 15:57:52 -0800 Andrew Morton <akpm@osdl.org> wrote:

| "Randy.Dunlap" <rddunlap@osdl.org> wrote:
| >
| > diff -Naurp ./drivers/media/video/meye.c~meye_dma ./drivers/media/video/meye.c
| > --- ./drivers/media/video/meye.c~meye_dma	2004-01-08 22:59:44.000000000 -0800
| > +++ ./drivers/media/video/meye.c	2004-02-03 14:43:42.000000000 -0800
| > @@ -162,7 +162,7 @@ static void rvfree(void * mem, unsigned 
| > 
| >  /* return a page table pointing to N pages of locked memory */
| >  static int ptable_alloc(void) {
| > -	u32 *pt;
| > +	dma_addr_t *pt;
| >  	int i;
| > 
| >  	memset(meye.mchip_ptable, 0, sizeof(meye.mchip_ptable));
| > @@ -176,7 +176,7 @@ static int ptable_alloc(void) {
| >  		return -1;
| >  	}
| > 
| > -	pt = (u32 *)meye.mchip_ptable[MCHIP_NB_PAGES];
| > +	pt = (dma_addr_t *)meye.mchip_ptable[MCHIP_NB_PAGES];
| >  	for (i = 0; i < MCHIP_NB_PAGES; i++) {
| >  		meye.mchip_ptable[i] = dma_alloc_coherent(&meye.mchip_dev->dev, 
| >  							  PAGE_SIZE,
| 
| mchip_ptable[] just contains pointers to kernel memory.  It doesn't seem
| appropriate to be casting these to dma_addr_t's


Ugh... if I am reading this correcly, what I see is that
mchip_table[] is mostly used for kernel pointers, like you say.

However, the last entry is used for dma handles returned by
dma_alloc_coherent() [the ptable toc], and these are not the correct
data type when CONFIG_HIGHMEM64G=y.

I expect that Stelian will sort this out, but it looks to me
like the ptable toc should be a different array (and type).

--
~Randy
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:00    [W:0.122 / U:0.050 seconds]
©2003-2008 Jasper Spaans