public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Mauro Carvalho Chehab <mchehab@infradead.org>
To: Andrew Morton <akpm@osdl.org>
Cc: Martin Bligh <mbligh@google.com>, Sujoy Gupta <sujoy@google.com>,
	LKML <linux-kernel@vger.kernel.org>,
	video4linux-list@redhat.com
Subject: Re: [PATCH] fix compiler warning in drivers/media/video/video-buf.c
Date: Fri, 29 Sep 2006 16:54:07 -0300	[thread overview]
Message-ID: <1159559648.10055.35.camel@praia> (raw)
In-Reply-To: <20060928105108.88b37304.akpm@osdl.org>

Em Qui, 2006-09-28 às 10:51 -0700, Andrew Morton escreveu:
> On Thu, 28 Sep 2006 10:31:58 -0700
> Martin Bligh <mbligh@google.com> wrote:

> That being said, this driver is wrong to be storing dma addresses in a
> void*.  And indeed there is a FIXME regarding this at
> include/linux/videodev2.h:476, so I guess hiding this warning won't obscure
> any fault which wasn't already known about..

Yes. The original structure is:

struct v4l2_framebuffer
{
        __u32                   capability;
        __u32                   flags;
        void*                   base;
        struct v4l2_pix_format  fmt;
};

Since this is used at ioctl definition, changing this would break
userspace apps. We might replace this to something like:

struct v4l2_framebuffer
{
        __u32                   capability;
        __u32                   flags;
	union {
	        void*		base_ptr; /*FOO definition to avoid breaking userpace apps */
		dma_addr_t	base;
	}
        struct v4l2_pix_format  fmt;
};

This way, base will have the expected type, and it won't break any
userspace app if sizeof(void *)<=sizeof(base). I think this is true for
all architectures (anyway, if it isn't, v4l is broken anyway).

What do you think?

Cheers, 
Mauro.


  reply	other threads:[~2006-09-29 19:54 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-09-28 17:31 [PATCH] fix compiler warning in drivers/media/video/video-buf.c Martin Bligh
2006-09-28 17:37 ` Nish Aravamudan
2006-09-28 17:51 ` Andrew Morton
2006-09-29 19:54   ` Mauro Carvalho Chehab [this message]
2006-09-29 19:59     ` Martin Bligh

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=1159559648.10055.35.camel@praia \
    --to=mchehab@infradead.org \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mbligh@google.com \
    --cc=sujoy@google.com \
    --cc=video4linux-list@redhat.com \
    /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