Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760315AbZAUJv0 (ORCPT ); Wed, 21 Jan 2009 04:51:26 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754398AbZAUJvP (ORCPT ); Wed, 21 Jan 2009 04:51:15 -0500 Received: from mail3.sea5.speakeasy.net ([69.17.117.5]:40063 "EHLO mail3.sea5.speakeasy.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750879AbZAUJvO (ORCPT ); Wed, 21 Jan 2009 04:51:14 -0500 Date: Wed, 21 Jan 2009 01:51:10 -0800 (PST) From: Trent Piepho X-X-Sender: xyzzy@shell2.speakeasy.net To: Arnd Bergmann cc: Jaswinder Singh Rajput , Mauro Carvalho Chehab , Jaswinder Singh Rajput , linux-media@vger.kernel.org, video4linux-list@redhat.com, Sam Ravnborg , Ingo Molnar , LKML Subject: Re: Confusion in usr/include/linux/videodev.h In-Reply-To: <200901211009.14856.arnd@arndb.de> Message-ID: References: <1232502038.3123.61.camel@localhost.localdomain> <3f9a31f40901210059g51d46f56t85364d886b757a6e@mail.gmail.com> <200901211009.14856.arnd@arndb.de> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1857 Lines: 47 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 > > > #include > > > > > > -#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 */ -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/