From: Trent Piepho <xyzzy@speakeasy.org>
To: Arnd Bergmann <arnd@arndb.de>
Cc: Jaswinder Singh Rajput <jaswinderlinux@gmail.com>,
Mauro Carvalho Chehab <mchehab@infradead.org>,
Jaswinder Singh Rajput <jaswinder@kernel.org>,
linux-media@vger.kernel.org, video4linux-list@redhat.com,
Sam Ravnborg <sam@ravnborg.org>, Ingo Molnar <mingo@elte.hu>,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: Confusion in usr/include/linux/videodev.h
Date: Wed, 21 Jan 2009 01:51:10 -0800 (PST) [thread overview]
Message-ID: <Pine.LNX.4.58.0901210129350.13170@shell2.speakeasy.net> (raw)
In-Reply-To: <200901211009.14856.arnd@arndb.de>
On Wed, 21 Jan 2009, Arnd Bergmann wrote:
> On Wednesday 21 January 2009, Jaswinder Singh Rajput wrote:
> > > diff -r 29c5787efcda linux/include/linux/videodev.h
> > > --- a/linux/include/linux/videodev.h Thu Jan 15 09:07:03 2009 -0800
> > > +++ b/linux/include/linux/videodev.h Wed Jan 21 00:51:45 2009 -0800
> > > @@ -15,7 +15,8 @@
> > > #include <linux/ioctl.h>
> > > #include <linux/videodev2.h>
> > >
> > > -#if defined(CONFIG_VIDEO_V4L1_COMPAT) || !defined (__KERNEL__)
> > > +#if (defined(__KERNEL__) && defined(CONFIG_VIDEO_V4L1_COMPAT)) \
> > > + || !defined (__KERNEL__)
> > >
> > > #define VID_TYPE_CAPTURE 1 /* Can capture */
> > > #define VID_TYPE_TUNER 2 /* Can tune */
> > >
> > > Now CONFIG_VIDEO_V4L1_COMPAT will only be used in the kernel.
> > >
> >
> > No, this will still give warnings.
>
> You could #define another conditional, like this:
>
> #ifndef __KERNEL__
> # define __V4L1_COMPAT_API /* Always provide definitions to user space */
> #else /* __KERNEL__ */
> # ifdef CONFIG_VIDEO_V4L1_COMPAT
> # define __V4L1_COMPAT_API
> # endif /* CONFIG_VIDEO_V4L1_COMPAT /*
> #endif /* __KERNEL__ */
I see what the real problem is now, the unifdef program isn't smart enough
to realize that it knows the result of !defined(__KERNEL__) || defined(FOO)
and so it keeps those ifdefs in when it should be able to remove them.
This works too:
#ifndef __KERNEL__
# define __V4L1_COMPAT_API /* Always provide definitions to user space */
#elif defined(CONFIG_VIDEO_V4L1_COMPAT) /* __KERNEL__ */
# define __V4L1_COMPAT_API
#endif /* CONFIG_VIDEO_V4L1_COMPAT */
prev parent reply other threads:[~2009-01-21 9:51 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-01-21 1:40 Jaswinder Singh Rajput
2009-01-21 1:50 ` Mauro Carvalho Chehab
2009-01-21 4:44 ` Jaswinder Singh Rajput
2009-01-21 8:54 ` Trent Piepho
2009-01-21 8:59 ` Jaswinder Singh Rajput
2009-01-21 9:09 ` Arnd Bergmann
2009-01-21 9:51 ` Trent Piepho [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=Pine.LNX.4.58.0901210129350.13170@shell2.speakeasy.net \
--to=xyzzy@speakeasy.org \
--cc=arnd@arndb.de \
--cc=jaswinder@kernel.org \
--cc=jaswinderlinux@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@infradead.org \
--cc=mingo@elte.hu \
--cc=sam@ravnborg.org \
--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
all inboxes | Powered by JetHome®