public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Randy.Dunlap" <rddunlap@osdl.org>
To: Andrew Morton <akpm@osdl.org>
Cc: linux-kernel@vger.kernel.org, stelian@popies.net
Subject: Re: [PATCH] meye: correct printk of dma_addr_t
Date: Tue, 3 Feb 2004 16:28:22 -0800	[thread overview]
Message-ID: <20040203162822.64ee18e1.rddunlap@osdl.org> (raw)
In-Reply-To: <20040203155752.17a8e274.akpm@osdl.org>

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

  reply	other threads:[~2004-02-04  0:34 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-02-03 23:36 [PATCH] meye: correct printk of dma_addr_t Randy.Dunlap
2004-02-03 23:57 ` Andrew Morton
2004-02-04  0:28   ` Randy.Dunlap [this message]
2004-02-04  8:44     ` Stelian Pop
2004-02-04 16:05       ` Randy.Dunlap
2004-02-05 13:37         ` Stelian Pop

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20040203162822.64ee18e1.rddunlap@osdl.org \
    --to=rddunlap@osdl.org \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stelian@popies.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox