All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mauro Carvalho Chehab <mchehab@infradead.org>
To: Trent Piepho <xyzzy@speakeasy.org>
Cc: Robert Fitzsimons <robfitz@273k.net>,
	Andrew Morton <akpm@osdl.org>,
	Linux and Kernel Video <video4linux-list@redhat.com>,
	76306.1226@compuserve.com, fork0@t-online.de, greg@kroah.com,
	linux-kernel@vger.kernel.org,
	"Randy.Dunlap" <rdunlap@xenotime.net>,
	v4l-dvb maintainer list <v4l-dvb-maintainer@linuxtv.org>,
	shemminger@osdl.org
Subject: Re: [v4l-dvb-maintainer] Re: [PATCH] V4L: struct video_device corruption
Date: Wed, 19 Jul 2006 08:54:52 -0300	[thread overview]
Message-ID: <1153310092.27276.9.camel@praia> (raw)
In-Reply-To: <Pine.LNX.4.58.0607171650510.18488@shell3.speakeasy.net>

Em Seg, 2006-07-17 às 17:25 -0700, Trent Piepho escreveu:
> On Sat, 15 Jul 2006, Mauro Carvalho Chehab wrote:
> > Em Sb, 2006-07-15 s 23:08 +0000, Robert Fitzsimons escreveu:
> > > The layout of struct video_device would change depending on whether
> > > videodev.h (V4L1) was include or not before v4l2-dev.h, which caused
> > > the structure to get corrupted.
> > Hmm... good point! However, I the proper solution would be to trust on
> > CONFIG_VIDEO_V4L1_COMPAT or CONFIG_VIDEO_V4L1 instead. it makes no sense
> > to keep a pointer to an unsupported callback, when V4L1 is not selected.
> 
> It's not so clear that the problem is with v4l2-dev.h, because if you look
> that file:
> 
> #ifdef CONFIG_VIDEO_V4L1
> #include <linux/videodev.h>
> #else
> #include <linux/videodev2.h>
> #endif
That's true. I think the OOPS is related to this -git patch:
http://www.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=6ab3d5624e172c553004ecc862bfeac16d9d68b7

It removed config.h from bttv-cards (and other places), but we need
CONFIG_* symbols before including v4l2-dev.h. Maybe the right solution
would be to include autoconf.h or config.h at the top of v4l2-dev.h.

> 
> linux/videodev.h is where HAVE_V4L1 is defined (always).  So, if
> CONFIG_VIDEO_V4L1 is set, then HAVE_V4L1 must also bet set.
> 
> I think that the real problem is that many drivers include the V4L1 API
> file videodev.h when V4L1 is NOT on.  Should drivers be providing V4L1 API
> functions, or need anything from videodev.h, if V4L1 is not on?
> 
> It seems like they either need to depend on VIDEO_V4L1 or only include the
> V4L1 API header file when V4L1 is turned on.  Which also means they would
> need to #ifdef out any V4L1 code when V4L1 is turned off.  The bttv driver
> for example does not do this.  It includes a bunch of V4L1 functions even
> when V4L1 (and V4L1_COMPAT) are turned off.
> 
> BTW, I think the CONFIG_VIDEO_V4L1 check in v4l2-dev.h should instead check
> for CONFIG_VIDEO_V4L1_COMPAT.  For example, cx88-video.c includes
> videodev.h when CONFIG_VIDEO_V4L1_COMPAT is turned on.
Yes, you are right. Checking for COMPAT covers both cases.

Cheers, 
Mauro.


  reply	other threads:[~2006-07-19 15:28 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-07-13  4:43 oops in bttv Chuck Ebbert
2006-07-13  5:05 ` Greg KH
2006-07-13  5:24   ` Randy.Dunlap
2006-07-13  5:44     ` Andrew Morton
2006-07-15 23:08       ` [PATCH] V4L: struct video_device corruption Robert Fitzsimons
2006-07-16  1:31         ` Mauro Carvalho Chehab
2006-07-18  0:25           ` [v4l-dvb-maintainer] " Trent Piepho
2006-07-19 11:54             ` Mauro Carvalho Chehab [this message]
2006-07-19 15:36               ` Michael Krufky
2006-07-20 21:57               ` Trent Piepho
2006-07-21 12:26                 ` Mauro Carvalho Chehab
2006-07-21 20:06                   ` Trent Piepho
2006-07-21 20:30                     ` Mauro Carvalho Chehab
2006-07-21 22:55                       ` Trent Piepho
2006-07-23  9:35                         ` Mauro Carvalho Chehab
2006-07-24  2:16                           ` Trent Piepho
2006-07-24 12:34                             ` Mauro Carvalho Chehab
2006-07-24 22:06                               ` Trent Piepho
2006-07-25 17:59                                 ` Mauro Carvalho Chehab
2006-07-25  3:08           ` Andrew Morton
2006-07-25  7:57             ` [v4l-dvb-maintainer] " Manu Abraham
2006-07-25  8:42             ` Trent Piepho
2006-07-25  9:06               ` Andrew Morton
2006-07-25 12:28                 ` Mauro Carvalho Chehab

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=1153310092.27276.9.camel@praia \
    --to=mchehab@infradead.org \
    --cc=76306.1226@compuserve.com \
    --cc=akpm@osdl.org \
    --cc=fork0@t-online.de \
    --cc=greg@kroah.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rdunlap@xenotime.net \
    --cc=robfitz@273k.net \
    --cc=shemminger@osdl.org \
    --cc=v4l-dvb-maintainer@linuxtv.org \
    --cc=video4linux-list@redhat.com \
    --cc=xyzzy@speakeasy.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.