From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755855Ab1CGKUP (ORCPT ); Mon, 7 Mar 2011 05:20:15 -0500 Received: from cantor.suse.de ([195.135.220.2]:38550 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754359Ab1CGKUM (ORCPT ); Mon, 7 Mar 2011 05:20:12 -0500 Date: Mon, 07 Mar 2011 11:20:11 +0100 Message-ID: From: Takashi Iwai To: Nicholas Niro Cc: linux-kernel@vger.kernel.org Subject: Re: [PATCH] sound: Added missing conditionnal for OSS function prototypes In-Reply-To: <1299305272-15861-1-git-send-email-nik_89@neuroponic.com> References: <1299305272-15861-1-git-send-email-nik_89@neuroponic.com> User-Agent: Wanderlust/2.15.6 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.7 Emacs/23.2 (x86_64-suse-linux-gnu) MULE/6.0 (HANACHIRUSATO) 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 Sat, 05 Mar 2011 01:07:52 -0500, Nicholas Niro wrote: > > As per the source file sound/sound_core.c, the function prototypes > register_sound_special, register_sound_special_device et al, are > all prototypes that are only compiled when the flag > CONFIG_SOUND_OSS_CORE is set. But regardless of if > it is set, those prototypes are still all > available in linux/sound.h. Well, the conventional way for such a case is to define dummy functions with static inline. > This bug was found when trying to compile standalone alsa. > In order to check for the function register_sound_special_device > availability, it looks for it's prototype in linux/sound.h and of course > it finds it because of the bug (even if it's not, actually, compiled in), > creating unknown symbol errors when loading snd.ko et al. I don't think it's worth to patch such a deadly old and almost deprecated file just for the builds of external module tree. It's basically a problem of alsa-driver external build system (likely it wrongly detects CONFIG_SND_OSSEMUL). This is the thing to be fixed. thanks, Takashi > --- > include/linux/sound.h | 2 ++ > 1 files changed, 2 insertions(+), 0 deletions(-) > > diff --git a/include/linux/sound.h b/include/linux/sound.h > index 44dcf05..7e49712 100644 > --- a/include/linux/sound.h > +++ b/include/linux/sound.h > @@ -30,6 +30,7 @@ > * Sound core interface functions > */ > > +#ifdef CONFIG_SOUND_OSS_CORE > struct device; > extern int register_sound_special(const struct file_operations *fops, int unit); > extern int register_sound_special_device(const struct file_operations *fops, int unit, struct device *dev); > @@ -41,4 +42,5 @@ extern void unregister_sound_special(int unit); > extern void unregister_sound_mixer(int unit); > extern void unregister_sound_midi(int unit); > extern void unregister_sound_dsp(int unit); > +#endif /* CONFIG_SOUND_OSS_CORE */ > #endif /* __KERNEL__ */ > -- > 1.7.4.1.107.g394f >