[alsa-devel] [PATCH 1/3] ALSA: opl4: Use IS_REACHABLE()
Rewrite the complex ifdef condition with IS_REACHABLE(). The ifdef in opl4_local.h was without defined(MODLE) check, but this is likely the oversight. Use IS_REACHABLE() here as well.
Signed-off-by: Takashi Iwai tiwai@suse.de --- sound/drivers/opl4/opl4_lib.c | 4 ++-- sound/drivers/opl4/opl4_local.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/sound/drivers/opl4/opl4_lib.c b/sound/drivers/opl4/opl4_lib.c index 89c7aa04b3bc..240656e54400 100644 --- a/sound/drivers/opl4/opl4_lib.c +++ b/sound/drivers/opl4/opl4_lib.c @@ -153,7 +153,7 @@ static int snd_opl4_detect(struct snd_opl4 *opl4) return 0; }
-#if defined(CONFIG_SND_SEQUENCER) || (defined(MODULE) && defined(CONFIG_SND_SEQUENCER_MODULE)) +#if IS_REACHABLE(CONFIG_SND_SEQUENCER) static void snd_opl4_seq_dev_free(struct snd_seq_device *seq_dev) { struct snd_opl4 *opl4 = seq_dev->private_data; @@ -249,7 +249,7 @@ int snd_opl4_create(struct snd_card *card, snd_opl4_create_mixer(opl4); snd_opl4_create_proc(opl4);
-#if defined(CONFIG_SND_SEQUENCER) || (defined(MODULE) && defined(CONFIG_SND_SEQUENCER_MODULE)) +#if IS_REACHABLE(CONFIG_SND_SEQUENCER) opl4->seq_client = -1; if (opl4->hardware < OPL3_HW_OPL4_ML) snd_opl4_create_seq_dev(opl4, seq_device); diff --git a/sound/drivers/opl4/opl4_local.h b/sound/drivers/opl4/opl4_local.h index 9a41bdebce6b..d5bac93f8245 100644 --- a/sound/drivers/opl4/opl4_local.h +++ b/sound/drivers/opl4/opl4_local.h @@ -184,7 +184,7 @@ struct snd_opl4 { #endif struct mutex access_mutex;
-#if defined(CONFIG_SND_SEQUENCER) || defined(CONFIG_SND_SEQUENCER_MODULE) +#if IS_REACHABLE(CONFIG_SND_SEQUENCER) int used;
int seq_dev_num;
Replace the complex ifdef conditions with IS_REACHABLE() macro. No functional changes.
Signed-off-by: Takashi Iwai tiwai@suse.de --- sound/isa/sb/emu8000.c | 2 +- sound/isa/sb/sb16.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/sound/isa/sb/emu8000.c b/sound/isa/sb/emu8000.c index ec180708f160..0b5c4cf3abfa 100644 --- a/sound/isa/sb/emu8000.c +++ b/sound/isa/sb/emu8000.c @@ -1138,7 +1138,7 @@ snd_emu8000_new(struct snd_card *card, int index, long port, int seq_ports, snd_emu8000_free(hw); return err; } -#if defined(CONFIG_SND_SEQUENCER) || (defined(MODULE) && defined(CONFIG_SND_SEQUENCER_MODULE)) +#if IS_REACHABLE(CONFIG_SND_SEQUENCER) if (snd_seq_device_new(card, index, SNDRV_SEQ_DEV_ID_EMU8000, sizeof(struct snd_emu8000*), &awe) >= 0) { strcpy(awe->name, "EMU-8000"); diff --git a/sound/isa/sb/sb16.c b/sound/isa/sb/sb16.c index 3b2e4f405ff2..31ab09b3b049 100644 --- a/sound/isa/sb/sb16.c +++ b/sound/isa/sb/sb16.c @@ -62,7 +62,7 @@ MODULE_SUPPORTED_DEVICE("{{Creative Labs,SB AWE 32}," #define SNDRV_DEBUG_IRQ #endif
-#if defined(SNDRV_SBAWE) && (defined(CONFIG_SND_SEQUENCER) || (defined(MODULE) && defined(CONFIG_SND_SEQUENCER_MODULE))) +#if defined(SNDRV_SBAWE) && IS_REACHABLE(CONFIG_SND_SEQUENCER) #define SNDRV_SBAWE_EMU8000 #endif
The comment at endif line was forgotten to be corrected when the condition was converted to IS_REACHABLE(). Fix it, too.
Signed-off-by: Takashi Iwai tiwai@suse.de --- sound/pci/cs4281.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/pci/cs4281.c b/sound/pci/cs4281.c index f870697aca67..ee7ba4b0b47b 100644 --- a/sound/pci/cs4281.c +++ b/sound/pci/cs4281.c @@ -1296,7 +1296,7 @@ static void snd_cs4281_free_gameport(struct cs4281 *chip) #else static inline int snd_cs4281_create_gameport(struct cs4281 *chip) { return -ENOSYS; } static inline void snd_cs4281_free_gameport(struct cs4281 *chip) { } -#endif /* CONFIG_GAMEPORT || (MODULE && CONFIG_GAMEPORT_MODULE) */ +#endif /* IS_REACHABLE(CONFIG_GAMEPORT) */
static int snd_cs4281_free(struct cs4281 *chip) {
Takashi Iwai wrote:
Rewrite the complex ifdef condition with IS_REACHABLE(). The ifdef in opl4_local.h was without defined(MODLE) check, but this is likely the oversight. Use IS_REACHABLE() here as well.
Signed-off-by: Takashi Iwai tiwai@suse.de
Acked-by: Clemens Ladisch clemens@ladisch.de
sound/drivers/opl4/opl4_lib.c | 4 ++-- sound/drivers/opl4/opl4_local.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/sound/drivers/opl4/opl4_lib.c b/sound/drivers/opl4/opl4_lib.c index 89c7aa04b3bc..240656e54400 100644 --- a/sound/drivers/opl4/opl4_lib.c +++ b/sound/drivers/opl4/opl4_lib.c @@ -153,7 +153,7 @@ static int snd_opl4_detect(struct snd_opl4 *opl4) return 0; }
-#if defined(CONFIG_SND_SEQUENCER) || (defined(MODULE) && defined(CONFIG_SND_SEQUENCER_MODULE)) +#if IS_REACHABLE(CONFIG_SND_SEQUENCER) static void snd_opl4_seq_dev_free(struct snd_seq_device *seq_dev) { struct snd_opl4 *opl4 = seq_dev->private_data; @@ -249,7 +249,7 @@ int snd_opl4_create(struct snd_card *card, snd_opl4_create_mixer(opl4); snd_opl4_create_proc(opl4);
-#if defined(CONFIG_SND_SEQUENCER) || (defined(MODULE) && defined(CONFIG_SND_SEQUENCER_MODULE)) +#if IS_REACHABLE(CONFIG_SND_SEQUENCER) opl4->seq_client = -1; if (opl4->hardware < OPL3_HW_OPL4_ML) snd_opl4_create_seq_dev(opl4, seq_device); diff --git a/sound/drivers/opl4/opl4_local.h b/sound/drivers/opl4/opl4_local.h index 9a41bdebce6b..d5bac93f8245 100644 --- a/sound/drivers/opl4/opl4_local.h +++ b/sound/drivers/opl4/opl4_local.h @@ -184,7 +184,7 @@ struct snd_opl4 { #endif struct mutex access_mutex;
-#if defined(CONFIG_SND_SEQUENCER) || defined(CONFIG_SND_SEQUENCER_MODULE) +#if IS_REACHABLE(CONFIG_SND_SEQUENCER) int used;
int seq_dev_num;
participants (2)
-
Clemens Ladisch
-
Takashi Iwai