Commit 8eeaa2f9 authored by Takashi Iwai's avatar Takashi Iwai

ALSA: Replace with IS_ENABLED()

Replace the lengthy #if defined(XXX) || defined(XXX_MODULE) with the
new IS_ENABLED() macro.

The patch still doesn't cover all ifdefs.  For example, the dependency
on CONFIG_GAMEPORT is still open-coded because this also has an extra
dependency on MODULE.  Similarly, an open-coded ifdef in pcm_oss.c and
some sequencer-related stuff are left untouched.
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 0a11458c
...@@ -151,7 +151,7 @@ void snd_ctl_notify(struct snd_card *card, unsigned int mask, ...@@ -151,7 +151,7 @@ void snd_ctl_notify(struct snd_card *card, unsigned int mask,
if (snd_BUG_ON(!card || !id)) if (snd_BUG_ON(!card || !id))
return; return;
read_lock(&card->ctl_files_rwlock); read_lock(&card->ctl_files_rwlock);
#if defined(CONFIG_SND_MIXER_OSS) || defined(CONFIG_SND_MIXER_OSS_MODULE) #if IS_ENABLED(CONFIG_SND_MIXER_OSS)
card->mixer_oss_change_count++; card->mixer_oss_change_count++;
#endif #endif
list_for_each_entry(ctl, &card->ctl_files, list) { list_for_each_entry(ctl, &card->ctl_files, list) {
......
...@@ -540,7 +540,7 @@ int __init snd_info_init(void) ...@@ -540,7 +540,7 @@ int __init snd_info_init(void)
snd_oss_root = entry; snd_oss_root = entry;
} }
#endif #endif
#if defined(CONFIG_SND_SEQUENCER) || defined(CONFIG_SND_SEQUENCER_MODULE) #if IS_ENABLED(CONFIG_SND_SEQUENCER)
{ {
struct snd_info_entry *entry; struct snd_info_entry *entry;
if ((entry = snd_info_create_module_entry(THIS_MODULE, "seq", NULL)) == NULL) if ((entry = snd_info_create_module_entry(THIS_MODULE, "seq", NULL)) == NULL)
...@@ -567,7 +567,7 @@ int __exit snd_info_done(void) ...@@ -567,7 +567,7 @@ int __exit snd_info_done(void)
snd_minor_info_done(); snd_minor_info_done();
snd_info_version_done(); snd_info_version_done();
if (snd_proc_root) { if (snd_proc_root) {
#if defined(CONFIG_SND_SEQUENCER) || defined(CONFIG_SND_SEQUENCER_MODULE) #if IS_ENABLED(CONFIG_SND_SEQUENCER)
snd_info_free_entry(snd_seq_root); snd_info_free_entry(snd_seq_root);
#endif #endif
#ifdef CONFIG_SND_OSSEMUL #ifdef CONFIG_SND_OSSEMUL
......
...@@ -94,7 +94,7 @@ static int module_slot_match(struct module *module, int idx) ...@@ -94,7 +94,7 @@ static int module_slot_match(struct module *module, int idx)
return match; return match;
} }
#if defined(CONFIG_SND_MIXER_OSS) || defined(CONFIG_SND_MIXER_OSS_MODULE) #if IS_ENABLED(CONFIG_SND_MIXER_OSS)
int (*snd_mixer_oss_notify_callback)(struct snd_card *card, int free_flag); int (*snd_mixer_oss_notify_callback)(struct snd_card *card, int free_flag);
EXPORT_SYMBOL(snd_mixer_oss_notify_callback); EXPORT_SYMBOL(snd_mixer_oss_notify_callback);
#endif #endif
...@@ -394,7 +394,7 @@ int snd_card_disconnect(struct snd_card *card) ...@@ -394,7 +394,7 @@ int snd_card_disconnect(struct snd_card *card)
/* phase 3: notify all connected devices about disconnection */ /* phase 3: notify all connected devices about disconnection */
/* at this point, they cannot respond to any calls except release() */ /* at this point, they cannot respond to any calls except release() */
#if defined(CONFIG_SND_MIXER_OSS) || defined(CONFIG_SND_MIXER_OSS_MODULE) #if IS_ENABLED(CONFIG_SND_MIXER_OSS)
if (snd_mixer_oss_notify_callback) if (snd_mixer_oss_notify_callback)
snd_mixer_oss_notify_callback(card, SND_MIXER_OSS_NOTIFY_DISCONNECT); snd_mixer_oss_notify_callback(card, SND_MIXER_OSS_NOTIFY_DISCONNECT);
#endif #endif
...@@ -430,7 +430,7 @@ EXPORT_SYMBOL(snd_card_disconnect); ...@@ -430,7 +430,7 @@ EXPORT_SYMBOL(snd_card_disconnect);
*/ */
static int snd_card_do_free(struct snd_card *card) static int snd_card_do_free(struct snd_card *card)
{ {
#if defined(CONFIG_SND_MIXER_OSS) || defined(CONFIG_SND_MIXER_OSS_MODULE) #if IS_ENABLED(CONFIG_SND_MIXER_OSS)
if (snd_mixer_oss_notify_callback) if (snd_mixer_oss_notify_callback)
snd_mixer_oss_notify_callback(card, SND_MIXER_OSS_NOTIFY_FREE); snd_mixer_oss_notify_callback(card, SND_MIXER_OSS_NOTIFY_FREE);
#endif #endif
...@@ -723,7 +723,7 @@ int snd_card_register(struct snd_card *card) ...@@ -723,7 +723,7 @@ int snd_card_register(struct snd_card *card)
snd_cards[card->number] = card; snd_cards[card->number] = card;
mutex_unlock(&snd_card_mutex); mutex_unlock(&snd_card_mutex);
init_info_for_card(card); init_info_for_card(card);
#if defined(CONFIG_SND_MIXER_OSS) || defined(CONFIG_SND_MIXER_OSS_MODULE) #if IS_ENABLED(CONFIG_SND_MIXER_OSS)
if (snd_mixer_oss_notify_callback) if (snd_mixer_oss_notify_callback)
snd_mixer_oss_notify_callback(card, SND_MIXER_OSS_NOTIFY_REGISTER); snd_mixer_oss_notify_callback(card, SND_MIXER_OSS_NOTIFY_REGISTER);
#endif #endif
......
...@@ -295,7 +295,7 @@ static const char *snd_pcm_state_name(snd_pcm_state_t state) ...@@ -295,7 +295,7 @@ static const char *snd_pcm_state_name(snd_pcm_state_t state)
return snd_pcm_state_names[(__force int)state]; return snd_pcm_state_names[(__force int)state];
} }
#if defined(CONFIG_SND_PCM_OSS) || defined(CONFIG_SND_PCM_OSS_MODULE) #if IS_ENABLED(CONFIG_SND_PCM_OSS)
#include <linux/soundcard.h> #include <linux/soundcard.h>
static const char *snd_pcm_oss_format_name(int format) static const char *snd_pcm_oss_format_name(int format)
...@@ -398,7 +398,7 @@ static void snd_pcm_substream_proc_hw_params_read(struct snd_info_entry *entry, ...@@ -398,7 +398,7 @@ static void snd_pcm_substream_proc_hw_params_read(struct snd_info_entry *entry,
snd_iprintf(buffer, "rate: %u (%u/%u)\n", runtime->rate, runtime->rate_num, runtime->rate_den); snd_iprintf(buffer, "rate: %u (%u/%u)\n", runtime->rate, runtime->rate_num, runtime->rate_den);
snd_iprintf(buffer, "period_size: %lu\n", runtime->period_size); snd_iprintf(buffer, "period_size: %lu\n", runtime->period_size);
snd_iprintf(buffer, "buffer_size: %lu\n", runtime->buffer_size); snd_iprintf(buffer, "buffer_size: %lu\n", runtime->buffer_size);
#if defined(CONFIG_SND_PCM_OSS) || defined(CONFIG_SND_PCM_OSS_MODULE) #if IS_ENABLED(CONFIG_SND_PCM_OSS)
if (substream->oss.oss) { if (substream->oss.oss) {
snd_iprintf(buffer, "OSS format: %s\n", snd_pcm_oss_format_name(runtime->oss.format)); snd_iprintf(buffer, "OSS format: %s\n", snd_pcm_oss_format_name(runtime->oss.format));
snd_iprintf(buffer, "OSS channels: %u\n", runtime->oss.channels); snd_iprintf(buffer, "OSS channels: %u\n", runtime->oss.channels);
...@@ -651,7 +651,7 @@ int snd_pcm_new_stream(struct snd_pcm *pcm, int stream, int substream_count) ...@@ -651,7 +651,7 @@ int snd_pcm_new_stream(struct snd_pcm *pcm, int stream, int substream_count)
struct snd_pcm_str *pstr = &pcm->streams[stream]; struct snd_pcm_str *pstr = &pcm->streams[stream];
struct snd_pcm_substream *substream, *prev; struct snd_pcm_substream *substream, *prev;
#if defined(CONFIG_SND_PCM_OSS) || defined(CONFIG_SND_PCM_OSS_MODULE) #if IS_ENABLED(CONFIG_SND_PCM_OSS)
mutex_init(&pstr->oss.setup_mutex); mutex_init(&pstr->oss.setup_mutex);
#endif #endif
pstr->stream = stream; pstr->stream = stream;
...@@ -807,7 +807,7 @@ EXPORT_SYMBOL(snd_pcm_new_internal); ...@@ -807,7 +807,7 @@ EXPORT_SYMBOL(snd_pcm_new_internal);
static void snd_pcm_free_stream(struct snd_pcm_str * pstr) static void snd_pcm_free_stream(struct snd_pcm_str * pstr)
{ {
struct snd_pcm_substream *substream, *substream_next; struct snd_pcm_substream *substream, *substream_next;
#if defined(CONFIG_SND_PCM_OSS) || defined(CONFIG_SND_PCM_OSS_MODULE) #if IS_ENABLED(CONFIG_SND_PCM_OSS)
struct snd_pcm_oss_setup *setup, *setupn; struct snd_pcm_oss_setup *setup, *setupn;
#endif #endif
substream = pstr->substream; substream = pstr->substream;
...@@ -819,7 +819,7 @@ static void snd_pcm_free_stream(struct snd_pcm_str * pstr) ...@@ -819,7 +819,7 @@ static void snd_pcm_free_stream(struct snd_pcm_str * pstr)
substream = substream_next; substream = substream_next;
} }
snd_pcm_stream_proc_done(pstr); snd_pcm_stream_proc_done(pstr);
#if defined(CONFIG_SND_PCM_OSS) || defined(CONFIG_SND_PCM_OSS_MODULE) #if IS_ENABLED(CONFIG_SND_PCM_OSS)
for (setup = pstr->oss.setup_list; setup; setup = setupn) { for (setup = pstr->oss.setup_list; setup; setup = setupn) {
setupn = setup->next; setupn = setup->next;
kfree(setup->task_name); kfree(setup->task_name);
......
...@@ -399,7 +399,7 @@ static int snd_pcm_hw_params(struct snd_pcm_substream *substream, ...@@ -399,7 +399,7 @@ static int snd_pcm_hw_params(struct snd_pcm_substream *substream,
return -EBADFD; return -EBADFD;
} }
snd_pcm_stream_unlock_irq(substream); snd_pcm_stream_unlock_irq(substream);
#if defined(CONFIG_SND_PCM_OSS) || defined(CONFIG_SND_PCM_OSS_MODULE) #if IS_ENABLED(CONFIG_SND_PCM_OSS)
if (!substream->oss.oss) if (!substream->oss.oss)
#endif #endif
if (atomic_read(&substream->mmap_count)) if (atomic_read(&substream->mmap_count))
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
#include <sound/core.h> #include <sound/core.h>
#include <sound/timer.h> #include <sound/timer.h>
#if defined(CONFIG_RTC) || defined(CONFIG_RTC_MODULE) #if IS_ENABLED(CONFIG_RTC)
#include <linux/mc146818rtc.h> #include <linux/mc146818rtc.h>
...@@ -185,4 +185,4 @@ MODULE_LICENSE("GPL"); ...@@ -185,4 +185,4 @@ MODULE_LICENSE("GPL");
MODULE_ALIAS("snd-timer-" __stringify(SNDRV_TIMER_GLOBAL_RTC)); MODULE_ALIAS("snd-timer-" __stringify(SNDRV_TIMER_GLOBAL_RTC));
#endif /* CONFIG_RTC || CONFIG_RTC_MODULE */ #endif /* IS_ENABLED(CONFIG_RTC) */
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
#ifdef CONFIG_SND_OSSEMUL #ifdef CONFIG_SND_OSSEMUL
#if !defined(CONFIG_SOUND) && !(defined(MODULE) && defined(CONFIG_SOUND_MODULE)) #if !IS_ENABLED(CONFIG_SOUND)
#error "Enable the OSS soundcore multiplexer (CONFIG_SOUND) in the kernel." #error "Enable the OSS soundcore multiplexer (CONFIG_SOUND) in the kernel."
#endif #endif
......
...@@ -35,9 +35,9 @@ ...@@ -35,9 +35,9 @@
#include <sound/initval.h> #include <sound/initval.h>
#include <linux/kmod.h> #include <linux/kmod.h>
#if defined(CONFIG_SND_HRTIMER) || defined(CONFIG_SND_HRTIMER_MODULE) #if IS_ENABLED(CONFIG_SND_HRTIMER)
#define DEFAULT_TIMER_LIMIT 4 #define DEFAULT_TIMER_LIMIT 4
#elif defined(CONFIG_SND_RTCTIMER) || defined(CONFIG_SND_RTCTIMER_MODULE) #elif IS_ENABLED(CONFIG_SND_RTCTIMER)
#define DEFAULT_TIMER_LIMIT 2 #define DEFAULT_TIMER_LIMIT 2
#else #else
#define DEFAULT_TIMER_LIMIT 1 #define DEFAULT_TIMER_LIMIT 1
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
#include <sound/opl3.h> #include <sound/opl3.h>
#include <sound/asound_fm.h> #include <sound/asound_fm.h>
#if defined(CONFIG_SND_SEQUENCER) || defined(CONFIG_SND_SEQUENCER_MODULE) #if IS_ENABLED(CONFIG_SND_SEQUENCER)
#define OPL3_SUPPORT_SYNTH #define OPL3_SUPPORT_SYNTH
#endif #endif
......
...@@ -4137,7 +4137,7 @@ static DEFINE_PCI_DEVICE_TABLE(azx_ids) = { ...@@ -4137,7 +4137,7 @@ static DEFINE_PCI_DEVICE_TABLE(azx_ids) = {
.driver_data = AZX_DRIVER_CTHDA | AZX_DCAPS_PRESET_CTHDA }, .driver_data = AZX_DRIVER_CTHDA | AZX_DCAPS_PRESET_CTHDA },
{ PCI_DEVICE(0x1102, 0x0012), { PCI_DEVICE(0x1102, 0x0012),
.driver_data = AZX_DRIVER_CTHDA | AZX_DCAPS_PRESET_CTHDA }, .driver_data = AZX_DRIVER_CTHDA | AZX_DCAPS_PRESET_CTHDA },
#if !defined(CONFIG_SND_CTXFI) && !defined(CONFIG_SND_CTXFI_MODULE) #if !IS_ENABLED(CONFIG_SND_CTXFI)
/* the following entry conflicts with snd-ctxfi driver, /* the following entry conflicts with snd-ctxfi driver,
* as ctxfi driver mutates from HD-audio to native mode with * as ctxfi driver mutates from HD-audio to native mode with
* a special command sequence. * a special command sequence.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment