Skip to content

Commit 8eeaa2f

Browse files
committed
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: Takashi Iwai <tiwai@suse.de>
1 parent 0a11458 commit 8eeaa2f

10 files changed

Lines changed: 20 additions & 20 deletions

File tree

‎sound/core/control.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ void snd_ctl_notify(struct snd_card *card, unsigned int mask,
151151
if (snd_BUG_ON(!card || !id))
152152
return;
153153
read_lock(&card->ctl_files_rwlock);
154-
#if defined(CONFIG_SND_MIXER_OSS) || defined(CONFIG_SND_MIXER_OSS_MODULE)
154+
#if IS_ENABLED(CONFIG_SND_MIXER_OSS)
155155
card->mixer_oss_change_count++;
156156
#endif
157157
list_for_each_entry(ctl, &card->ctl_files, list) {

‎sound/core/info.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -540,7 +540,7 @@ int __init snd_info_init(void)
540540
snd_oss_root = entry;
541541
}
542542
#endif
543-
#if defined(CONFIG_SND_SEQUENCER) || defined(CONFIG_SND_SEQUENCER_MODULE)
543+
#if IS_ENABLED(CONFIG_SND_SEQUENCER)
544544
{
545545
struct snd_info_entry *entry;
546546
if ((entry = snd_info_create_module_entry(THIS_MODULE, "seq", NULL)) == NULL)
@@ -567,7 +567,7 @@ int __exit snd_info_done(void)
567567
snd_minor_info_done();
568568
snd_info_version_done();
569569
if (snd_proc_root) {
570-
#if defined(CONFIG_SND_SEQUENCER) || defined(CONFIG_SND_SEQUENCER_MODULE)
570+
#if IS_ENABLED(CONFIG_SND_SEQUENCER)
571571
snd_info_free_entry(snd_seq_root);
572572
#endif
573573
#ifdef CONFIG_SND_OSSEMUL

‎sound/core/init.c‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ static int module_slot_match(struct module *module, int idx)
9494
return match;
9595
}
9696

97-
#if defined(CONFIG_SND_MIXER_OSS) || defined(CONFIG_SND_MIXER_OSS_MODULE)
97+
#if IS_ENABLED(CONFIG_SND_MIXER_OSS)
9898
int (*snd_mixer_oss_notify_callback)(struct snd_card *card, int free_flag);
9999
EXPORT_SYMBOL(snd_mixer_oss_notify_callback);
100100
#endif
@@ -394,7 +394,7 @@ int snd_card_disconnect(struct snd_card *card)
394394
/* phase 3: notify all connected devices about disconnection */
395395
/* at this point, they cannot respond to any calls except release() */
396396

397-
#if defined(CONFIG_SND_MIXER_OSS) || defined(CONFIG_SND_MIXER_OSS_MODULE)
397+
#if IS_ENABLED(CONFIG_SND_MIXER_OSS)
398398
if (snd_mixer_oss_notify_callback)
399399
snd_mixer_oss_notify_callback(card, SND_MIXER_OSS_NOTIFY_DISCONNECT);
400400
#endif
@@ -430,7 +430,7 @@ EXPORT_SYMBOL(snd_card_disconnect);
430430
*/
431431
static int snd_card_do_free(struct snd_card *card)
432432
{
433-
#if defined(CONFIG_SND_MIXER_OSS) || defined(CONFIG_SND_MIXER_OSS_MODULE)
433+
#if IS_ENABLED(CONFIG_SND_MIXER_OSS)
434434
if (snd_mixer_oss_notify_callback)
435435
snd_mixer_oss_notify_callback(card, SND_MIXER_OSS_NOTIFY_FREE);
436436
#endif
@@ -723,7 +723,7 @@ int snd_card_register(struct snd_card *card)
723723
snd_cards[card->number] = card;
724724
mutex_unlock(&snd_card_mutex);
725725
init_info_for_card(card);
726-
#if defined(CONFIG_SND_MIXER_OSS) || defined(CONFIG_SND_MIXER_OSS_MODULE)
726+
#if IS_ENABLED(CONFIG_SND_MIXER_OSS)
727727
if (snd_mixer_oss_notify_callback)
728728
snd_mixer_oss_notify_callback(card, SND_MIXER_OSS_NOTIFY_REGISTER);
729729
#endif

‎sound/core/pcm.c‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ static const char *snd_pcm_state_name(snd_pcm_state_t state)
295295
return snd_pcm_state_names[(__force int)state];
296296
}
297297

298-
#if defined(CONFIG_SND_PCM_OSS) || defined(CONFIG_SND_PCM_OSS_MODULE)
298+
#if IS_ENABLED(CONFIG_SND_PCM_OSS)
299299
#include <linux/soundcard.h>
300300

301301
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,
398398
snd_iprintf(buffer, "rate: %u (%u/%u)\n", runtime->rate, runtime->rate_num, runtime->rate_den);
399399
snd_iprintf(buffer, "period_size: %lu\n", runtime->period_size);
400400
snd_iprintf(buffer, "buffer_size: %lu\n", runtime->buffer_size);
401-
#if defined(CONFIG_SND_PCM_OSS) || defined(CONFIG_SND_PCM_OSS_MODULE)
401+
#if IS_ENABLED(CONFIG_SND_PCM_OSS)
402402
if (substream->oss.oss) {
403403
snd_iprintf(buffer, "OSS format: %s\n", snd_pcm_oss_format_name(runtime->oss.format));
404404
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)
651651
struct snd_pcm_str *pstr = &pcm->streams[stream];
652652
struct snd_pcm_substream *substream, *prev;
653653

654-
#if defined(CONFIG_SND_PCM_OSS) || defined(CONFIG_SND_PCM_OSS_MODULE)
654+
#if IS_ENABLED(CONFIG_SND_PCM_OSS)
655655
mutex_init(&pstr->oss.setup_mutex);
656656
#endif
657657
pstr->stream = stream;
@@ -807,7 +807,7 @@ EXPORT_SYMBOL(snd_pcm_new_internal);
807807
static void snd_pcm_free_stream(struct snd_pcm_str * pstr)
808808
{
809809
struct snd_pcm_substream *substream, *substream_next;
810-
#if defined(CONFIG_SND_PCM_OSS) || defined(CONFIG_SND_PCM_OSS_MODULE)
810+
#if IS_ENABLED(CONFIG_SND_PCM_OSS)
811811
struct snd_pcm_oss_setup *setup, *setupn;
812812
#endif
813813
substream = pstr->substream;
@@ -819,7 +819,7 @@ static void snd_pcm_free_stream(struct snd_pcm_str * pstr)
819819
substream = substream_next;
820820
}
821821
snd_pcm_stream_proc_done(pstr);
822-
#if defined(CONFIG_SND_PCM_OSS) || defined(CONFIG_SND_PCM_OSS_MODULE)
822+
#if IS_ENABLED(CONFIG_SND_PCM_OSS)
823823
for (setup = pstr->oss.setup_list; setup; setup = setupn) {
824824
setupn = setup->next;
825825
kfree(setup->task_name);

‎sound/core/pcm_native.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,7 @@ static int snd_pcm_hw_params(struct snd_pcm_substream *substream,
399399
return -EBADFD;
400400
}
401401
snd_pcm_stream_unlock_irq(substream);
402-
#if defined(CONFIG_SND_PCM_OSS) || defined(CONFIG_SND_PCM_OSS_MODULE)
402+
#if IS_ENABLED(CONFIG_SND_PCM_OSS)
403403
if (!substream->oss.oss)
404404
#endif
405405
if (atomic_read(&substream->mmap_count))

‎sound/core/rtctimer.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
#include <sound/core.h>
2828
#include <sound/timer.h>
2929

30-
#if defined(CONFIG_RTC) || defined(CONFIG_RTC_MODULE)
30+
#if IS_ENABLED(CONFIG_RTC)
3131

3232
#include <linux/mc146818rtc.h>
3333

@@ -185,4 +185,4 @@ MODULE_LICENSE("GPL");
185185

186186
MODULE_ALIAS("snd-timer-" __stringify(SNDRV_TIMER_GLOBAL_RTC));
187187

188-
#endif /* CONFIG_RTC || CONFIG_RTC_MODULE */
188+
#endif /* IS_ENABLED(CONFIG_RTC) */

‎sound/core/sound_oss.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
#ifdef CONFIG_SND_OSSEMUL
2323

24-
#if !defined(CONFIG_SOUND) && !(defined(MODULE) && defined(CONFIG_SOUND_MODULE))
24+
#if !IS_ENABLED(CONFIG_SOUND)
2525
#error "Enable the OSS soundcore multiplexer (CONFIG_SOUND) in the kernel."
2626
#endif
2727

‎sound/core/timer.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@
3535
#include <sound/initval.h>
3636
#include <linux/kmod.h>
3737

38-
#if defined(CONFIG_SND_HRTIMER) || defined(CONFIG_SND_HRTIMER_MODULE)
38+
#if IS_ENABLED(CONFIG_SND_HRTIMER)
3939
#define DEFAULT_TIMER_LIMIT 4
40-
#elif defined(CONFIG_SND_RTCTIMER) || defined(CONFIG_SND_RTCTIMER_MODULE)
40+
#elif IS_ENABLED(CONFIG_SND_RTCTIMER)
4141
#define DEFAULT_TIMER_LIMIT 2
4242
#else
4343
#define DEFAULT_TIMER_LIMIT 1

‎sound/drivers/opl3/opl3_synth.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
#include <sound/opl3.h>
2525
#include <sound/asound_fm.h>
2626

27-
#if defined(CONFIG_SND_SEQUENCER) || defined(CONFIG_SND_SEQUENCER_MODULE)
27+
#if IS_ENABLED(CONFIG_SND_SEQUENCER)
2828
#define OPL3_SUPPORT_SYNTH
2929
#endif
3030

‎sound/pci/hda/hda_intel.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4137,7 +4137,7 @@ static DEFINE_PCI_DEVICE_TABLE(azx_ids) = {
41374137
.driver_data = AZX_DRIVER_CTHDA | AZX_DCAPS_PRESET_CTHDA },
41384138
{ PCI_DEVICE(0x1102, 0x0012),
41394139
.driver_data = AZX_DRIVER_CTHDA | AZX_DCAPS_PRESET_CTHDA },
4140-
#if !defined(CONFIG_SND_CTXFI) && !defined(CONFIG_SND_CTXFI_MODULE)
4140+
#if !IS_ENABLED(CONFIG_SND_CTXFI)
41414141
/* the following entry conflicts with snd-ctxfi driver,
41424142
* as ctxfi driver mutates from HD-audio to native mode with
41434143
* a special command sequence.

0 commit comments

Comments
 (0)