sound/oss/dmasound: fix 'dmasound_setup' defined but not used
Subsystems (2)
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
@@ -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
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 warppingdmasound_setupwith #ifndef MODULES.Error(s):
sound/oss/dmasound/dmasound_core.c:1431:12: error: 'dmasound_setup' defined but not used [-Werror=unused-function]Signed-off-by Miles Chen <[email protected]>
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@@ -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
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_unusedto 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
AngeloGioacchino Del Regno
maintainerIl 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 warppingdmasound_setupwith #ifndef MODULES.Error(s):
sound/oss/dmasound/dmasound_core.c:1431:12: error: 'dmasound_setup' defined but not used [-Werror=unused-function]Signed-off-by Miles Chen <[email protected]>--- sound/oss/dmasound/dmasound_core.c | 2 ++ 1 file changed, 2 insertions(+)sound/oss/dmasound/dmasound_core.c +0
-0
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
Hi Angelo,
Quoted 2 lines
Hello Miles,
I agree with Takashi,__maybe_unusedlooks way better.
No problem, I posted v2 (with __maybe_unused).
https://lore.kernel.org/lkml/[email protected]/
Thanks,
Miles
Quoted 3 lines
Regards,
Angelo