Skip to contentSkip to conversation

ALSA: Fix declaration of sound_class

PATCH In review Mark Brown 2 participants 3 messages Dec 15, 2008 Sound

lore
Share & tools
lore

Mark Brown

author
#0 lore raw

PATCH 1/1 ALSA: Fix declaration of sound_class

Include sound/core.h in sound_core.c so that sound_class is declared before it is defined, avoiding it looking like it should be static.

---
 sound/sound_core.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
sound/sound_core.c +1 -0
index 10ba421..2b302bb 100644
@@ -10,6 +10,7 @@
 #include <linux/module.h>
 #include <linux/device.h>
 #include <linux/err.h>
+#include <sound/core.h>
 
 #ifdef CONFIG_SOUND_OSS_CORE
 static int __init init_oss_soundcore(void);
Signature · 1 line
1.5.6.5
#1 lore raw

At Mon, 15 Dec 2008 15:43:43 +0000,

Quoted 3 lines · Mark Brown

Include sound/core.h in sound_core.c so that sound_class is declared before it is defined, avoiding it looking like it should be static.

It's a question whether it should be in linux/sound.h or in sound/core.h, but as long as it's declared in the latter file, I think it's OK to included it from sound_core.c although it's not ALSA-specific.

So I applied as is. Thanks.

Takashi

Quoted 21 lines
---
 sound/sound_core.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
sound/sound_core.c +1 -0
index 10ba421..2b302bb 100644
@@ -10,6 +10,7 @@
 #include <linux/module.h>
 #include <linux/device.h>
 #include <linux/err.h>
+#include <sound/core.h>
 
 #ifdef CONFIG_SOUND_OSS_CORE
 static int __init init_oss_soundcore(void);
Signature · 1 line
1.5.6.5
author
#2 lore raw
Quoted 9 lines · Takashi Iwai
Quoted 2 lines · Mark Brown

Include sound/core.h in sound_core.c so that sound_class is declared before it is defined, avoiding it looking like it should be static.

It's a question whether it should be in linux/sound.h or in sound/core.h, but as long as it's declared in the latter file, I think it's OK to included it from sound_core.c although it's not ALSA-specific.

Yeah, the OSS code doesn't use the prototype from the header at all but instead has a local prototype in one of their C files which isn't terribly clever.