mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "David S. Miller" <davem@redhat.com>
To: Meelis Roos <mroos@linux.ee>
Cc: kraxel@bytesex.org, linux-kernel@vger.kernel.org
Subject: Re: video-buf warning
Date: Wed, 28 Apr 2004 12:19:40 -0700	[thread overview]
Message-ID: <20040428121940.06a90c02.davem@redhat.com> (raw)
In-Reply-To: <Pine.GSO.4.44.0404281150410.24906-100000@math.ut.ee>

On Wed, 28 Apr 2004 11:57:38 +0300 (EEST)
Meelis Roos <mroos@linux.ee> wrote:

>   CC [M]  drivers/media/video/video-buf.o
> drivers/media/video/video-buf.c: In function `videobuf_iolock':
> drivers/media/video/video-buf.c:327: warning: cast from pointer to integer of different size
 ...
> The specific code is
> /* FIXME: need sanity checks for vb->boff */
> bus   = (dma_addr_t)fbuf->base + vb->boff;
> 
> bus is dma_addr_t (==u32 on sparc64), base is void*
> 
> So if buf->base is really an arbitrary pointer, it might not fit into
> u32. What is it actually?

It is the physical address of a frame buffer, this code is allowing
user programs to point the video capturing to go directly onto a
frame buffer at a specific location.

Using dma_addr_t here is a poor choice, since that data type is to
be used to PCI DMA API interfaces for doing transfers to/from real
memory, not frame buffers and the like :-)

Unfortunately, there is no portable interface available for what
this code wants to do, which is device<-->device DMA transfers.
We would need to create an interface that took two device structures,
and some base+offset values, in order to provide a portable way to
do this, then a reworked version of this user interface would be needed
as well.

In short, it's long term to fix this up, don't worry about it for
now.

      reply	other threads:[~2004-04-28 20:04 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-04-28  8:57 Meelis Roos
2004-04-28 19:19 ` David S. Miller [this message]

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=20040428121940.06a90c02.davem@redhat.com \
    --to=davem@redhat.com \
    --cc=kraxel@bytesex.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mroos@linux.ee \
    /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

all inboxes | Powered by JetHome®