From mboxrd@z Thu Jan 1 00:00:00 1970 From: Takashi Iwai Subject: Re: usr/include/linux/soundcard.h warnings for 'make headers_check' Date: Wed, 04 Feb 2009 10:03:06 +0100 Message-ID: References: <1232465902.3088.31.camel@localhost.localdomain> <20090121054138.GA26551@uranus.ravnborg.org> <200902032127.24526.arnd@arndb.de> <1233720252.3595.5.camel@localhost.localdomain> <1233736494.3198.15.camel@localhost.localdomain> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by alsa0.perex.cz (Postfix) with ESMTP id 254C72444A for ; Wed, 4 Feb 2009 10:03:07 +0100 (CET) In-Reply-To: <1233736494.3198.15.camel@localhost.localdomain> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: alsa-devel-bounces@alsa-project.org Errors-To: alsa-devel-bounces@alsa-project.org To: Jaswinder Singh Rajput Cc: alsa-devel@alsa-project.org, Sam Ravnborg , Ingo Molnar , Arnd Bergmann , LKML List-Id: alsa-devel@alsa-project.org At Wed, 04 Feb 2009 14:04:54 +0530, Jaswinder Singh Rajput wrote: > > On Wed, 2009-02-04 at 07:39 +0100, Takashi Iwai wrote: > > At Wed, 04 Feb 2009 09:34:12 +0530, > > Jaswinder Singh Rajput wrote: > > > > > > On Tue, 2009-02-03 at 21:27 +0100, Arnd Bergmann wrote: > > > > On Wednesday 21 January 2009, Sam Ravnborg wrote: > > > > > > > > > > > No, these are declarations for OSS-lib. > > > > > > It doesn't belong to kernel, but it's better to keep it for > > > > > > compatibility in some way. > > > > > > > > > > But not in the kernel for sure. > > > > > I just checked and for example: OSS_init is not used anywhere in the kernel. > > > > > The kernel headers are not a "dump all your stuff" ground anymore. > > > > > > > > > > So I encourage you to find a better home for the user space library definitons. > > > > > We can let the definiton stay for a while - but eventually they have to > > > > > be dropped from the kernel. > > > > > > > > The last free version of OSSlib that matches this header is from ~1997, and > > > > no current distro appears to be shipping it. All new OSSlib versions (the > > > > oldest I found was from ~2003) contain in their documentation: > > > > > > > > "Older versions of some OSS include files are distributed > > > > with various operating systems. There is no danger in > > > > using them but applications written for more recent OSS > > > > versions will not compile with older header files. > > > > > > > > The latest versions of these include files (such as > > > > soundcard.h) are distributed in ../include/sys. Use > > > > the -I/usr/lib/oss/include switch when compiling > > > > programs. Alternatively copy these files to /usr/include/sys > > > > so that they replace the original ones." > > > > > > > > I think it's safe enough to assume that everyone that builds against > > > > OSSlib by now also has the correct version of the header installed. > > > > Consequently, we should just drop the #ifndef __KERNEL__ section > > > > of soundcard.h (all the macros in there depend on the extern > > > > declarations), and maybe add an > > > > > > > > #ifdef OSSLIB > > > > #error need to use from libOSSlib > > > > #endif > > > > > > > > > > sys/soundcard.h is also pointing to linux/soundcard.h, we need to move > > > all this stuff to sys/soundcard.h. > > > > All which stuff? > > If you are referring to OSS-lib stuff in soundcard.h, then I'm for > > it. > > > > We need to fix things in such a way that we can replace: > #if (!defined(__KERNEL__) && !defined(KERNEL) && !defined(INKERNEL) && !defined(_KERNEL)) || defined(USE_SEQ_MACROS) > with > #ifdef __KERNEL__ > and only keep those things in this file which we need in kernel and move > userspace declarations which are not required for kernel to > sys/soundcard.h Which means to remove only the OSS-lib part. Some other macros are used in sound/oss/*.c. And, there are cases that apps want to use SEQ* macros without oss-lib (which are actually most cases). > > Also giving an error with an ifdef OSSLIB like Arnd suggested would be > > nice, too. But maybe we need one more ifdef such as > > > > #ifdef OSSLIB > > #ifndef _SYS_SOUNDCARD_H > > #error ... > > #endif > > #endif > > > > hmm, so you want to confirm that we only come through sys/soundcard.h > for OSSLIB Yes. Takashi From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753948AbZBDJDd (ORCPT ); Wed, 4 Feb 2009 04:03:33 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751849AbZBDJDL (ORCPT ); Wed, 4 Feb 2009 04:03:11 -0500 Received: from mx2.suse.de ([195.135.220.15]:51163 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751816AbZBDJDJ (ORCPT ); Wed, 4 Feb 2009 04:03:09 -0500 Date: Wed, 04 Feb 2009 10:03:06 +0100 Message-ID: From: Takashi Iwai To: Jaswinder Singh Rajput Cc: Arnd Bergmann , Sam Ravnborg , alsa-devel@alsa-project.org, Ingo Molnar , LKML Subject: Re: usr/include/linux/soundcard.h warnings for 'make headers_check' In-Reply-To: <1233736494.3198.15.camel@localhost.localdomain> References: <1232465902.3088.31.camel@localhost.localdomain> <20090121054138.GA26551@uranus.ravnborg.org> <200902032127.24526.arnd@arndb.de> <1233720252.3595.5.camel@localhost.localdomain> <1233736494.3198.15.camel@localhost.localdomain> User-Agent: Wanderlust/2.12.0 (Your Wildest Dreams) SEMI/1.14.6 (Maruoka) FLIM/1.14.7 (=?ISO-8859-4?Q?Sanj=F2?=) APEL/10.6 Emacs/22.3 (x86_64-suse-linux-gnu) MULE/5.0 (SAKAKI) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org At Wed, 04 Feb 2009 14:04:54 +0530, Jaswinder Singh Rajput wrote: > > On Wed, 2009-02-04 at 07:39 +0100, Takashi Iwai wrote: > > At Wed, 04 Feb 2009 09:34:12 +0530, > > Jaswinder Singh Rajput wrote: > > > > > > On Tue, 2009-02-03 at 21:27 +0100, Arnd Bergmann wrote: > > > > On Wednesday 21 January 2009, Sam Ravnborg wrote: > > > > > > > > > > > No, these are declarations for OSS-lib. > > > > > > It doesn't belong to kernel, but it's better to keep it for > > > > > > compatibility in some way. > > > > > > > > > > But not in the kernel for sure. > > > > > I just checked and for example: OSS_init is not used anywhere in the kernel. > > > > > The kernel headers are not a "dump all your stuff" ground anymore. > > > > > > > > > > So I encourage you to find a better home for the user space library definitons. > > > > > We can let the definiton stay for a while - but eventually they have to > > > > > be dropped from the kernel. > > > > > > > > The last free version of OSSlib that matches this header is from ~1997, and > > > > no current distro appears to be shipping it. All new OSSlib versions (the > > > > oldest I found was from ~2003) contain in their documentation: > > > > > > > > "Older versions of some OSS include files are distributed > > > > with various operating systems. There is no danger in > > > > using them but applications written for more recent OSS > > > > versions will not compile with older header files. > > > > > > > > The latest versions of these include files (such as > > > > soundcard.h) are distributed in ../include/sys. Use > > > > the -I/usr/lib/oss/include switch when compiling > > > > programs. Alternatively copy these files to /usr/include/sys > > > > so that they replace the original ones." > > > > > > > > I think it's safe enough to assume that everyone that builds against > > > > OSSlib by now also has the correct version of the header installed. > > > > Consequently, we should just drop the #ifndef __KERNEL__ section > > > > of soundcard.h (all the macros in there depend on the extern > > > > declarations), and maybe add an > > > > > > > > #ifdef OSSLIB > > > > #error need to use from libOSSlib > > > > #endif > > > > > > > > > > sys/soundcard.h is also pointing to linux/soundcard.h, we need to move > > > all this stuff to sys/soundcard.h. > > > > All which stuff? > > If you are referring to OSS-lib stuff in soundcard.h, then I'm for > > it. > > > > We need to fix things in such a way that we can replace: > #if (!defined(__KERNEL__) && !defined(KERNEL) && !defined(INKERNEL) && !defined(_KERNEL)) || defined(USE_SEQ_MACROS) > with > #ifdef __KERNEL__ > and only keep those things in this file which we need in kernel and move > userspace declarations which are not required for kernel to > sys/soundcard.h Which means to remove only the OSS-lib part. Some other macros are used in sound/oss/*.c. And, there are cases that apps want to use SEQ* macros without oss-lib (which are actually most cases). > > Also giving an error with an ifdef OSSLIB like Arnd suggested would be > > nice, too. But maybe we need one more ifdef such as > > > > #ifdef OSSLIB > > #ifndef _SYS_SOUNDCARD_H > > #error ... > > #endif > > #endif > > > > hmm, so you want to confirm that we only come through sys/soundcard.h > for OSSLIB Yes. Takashi