Skip to contentSkip to conversation

sound/oss/dmasound: fix 'dmasound_setup' defined but not used

PATCH Superseded Miles Chen 3 participants 5 messages Apr 14, 2022

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Miles Chen

author
#0 lore raw

PATCH 1/1 sound/oss/dmasound: fix 'dmasound_setup' defined but not used

We observed: 'dmasound_setup' defined but not used error with COMPILER=gcc ARCH=m68k DEFCONFIG=allmodconfig build.

__setup() does not work if MODULE is defined. Fix it by warpping dmasound_setup with #ifndef MODULES.

Error(s):
sound/oss/dmasound/dmasound_core.c:1431:12: error: 'dmasound_setup' defined but not used [-Werror=unused-function]

---
 sound/oss/dmasound/dmasound_core.c | 2 ++
 1 file changed, 2 insertions(+)
sound/oss/dmasound/dmasound_core.c +2 -0
index 9c48f3a9e3d1..a1b3e71beadf 100644
@@ -1428,6 +1428,7 @@ void dmasound_deinit(void)
 		unregister_sound_dsp(sq_unit);
 }
 
+#ifndef MODULE
 static int dmasound_setup(char *str)
 {
 	int ints[6], size;
@@ -1470,6 +1471,7 @@ static int dmasound_setup(char *str)
 }
 
 __setup("dmasound=", dmasound_setup);
+#endif
 
     /*
      *  Conversion tables
Signature · 1 line
2.18.0
#1 lore raw
Quoted 11 lines · Miles Chen

We observed: 'dmasound_setup' defined but not used error with COMPILER=gcc ARCH=m68k DEFCONFIG=allmodconfig build.

__setup() does not work if MODULE is defined. Fix it by warpping dmasound_setup with #ifndef MODULES.

Error(s):
sound/oss/dmasound/dmasound_core.c:1431:12: error: 'dmasound_setup' defined but not used [-Werror=unused-function]

This must be a side-effect of the recent fix 9dd7c46346ca ("sound/oss/dmasound: fix build when drivers are mixed =y/=m"). Adding Randy to Cc.

IMO, a less uglier way would be to add __maybe_unused to that function. But it's a matter of taste.

thanks,

Takashi

Quoted 27 lines
---
 sound/oss/dmasound/dmasound_core.c | 2 ++
 1 file changed, 2 insertions(+)
sound/oss/dmasound/dmasound_core.c +2 -0
index 9c48f3a9e3d1..a1b3e71beadf 100644
@@ -1428,6 +1428,7 @@ void dmasound_deinit(void)
 		unregister_sound_dsp(sq_unit);
 }
 
+#ifndef MODULE
 static int dmasound_setup(char *str)
 {
 	int ints[6], size;
@@ -1470,6 +1471,7 @@ static int dmasound_setup(char *str)
 }
 
 __setup("dmasound=", dmasound_setup);
+#endif
 
     /*
      *  Conversion tables
Signature · 1 line
2.18.0
author
#2 lore raw

Hi Takashi,

Quoted 6 lines

This must be a side-effect of the recent fix 9dd7c46346ca ("sound/oss/dmasound: fix build when drivers are mixed =y/=m"). Adding Randy to Cc.

IMO, a less uglier way would be to add __maybe_unused to that function. But it's a matter of taste.

thanks, I will use __maybe_unused and the fix tag in v2.

Thanks,
Miles

Quoted 5 lines

thanks,

Takashi

#3 lore raw
In reply to Miles Chen

Il 14/04/22 10:11, Miles Chen ha scritto:

Quoted 19 lines

We observed: 'dmasound_setup' defined but not used error with COMPILER=gcc ARCH=m68k DEFCONFIG=allmodconfig build.

__setup() does not work if MODULE is defined. Fix it by warpping dmasound_setup with #ifndef MODULES.

Error(s):
sound/oss/dmasound/dmasound_core.c:1431:12: error: 'dmasound_setup' defined but not used [-Werror=unused-function]

---
  sound/oss/dmasound/dmasound_core.c | 2 ++
  1 file changed, 2 insertions(+)
sound/oss/dmasound/dmasound_core.c +0 -0
index 9c48f3a9e3d1..a1b3e71beadf 100644

sound/oss/dmasound/dmasound_core.c void dmasound_deinit(void) · line 1432

Quoted 5 lines
sound/oss/dmasound/dmasound_core.c +1 -0
@@ -1428,6 +1428,7 @@ void dmasound_deinit(void)
  		unregister_sound_dsp(sq_unit);
  }
 
+#ifndef MODULE
  static int dmasound_setup(char *str)

Hello Miles,
I agree with Takashi, __maybe_unused looks way better.

Regards,
Angelo