From 88faa38435cbfdf3e733a670a009683eb7057cdc Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Fri, 12 May 2017 11:44:54 +0200 Subject: ALSA: cmi8238: Use IS_ENABLED() Simplify the ifdef conditions with IS_ENABLED() macro. No functional changes. Signed-off-by: Takashi Iwai --- sound/isa/cmi8328.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sound/isa') diff --git a/sound/isa/cmi8328.c b/sound/isa/cmi8328.c index 8e1756c3b9bb..d09e456107ad 100644 --- a/sound/isa/cmi8328.c +++ b/sound/isa/cmi8328.c @@ -26,7 +26,7 @@ MODULE_AUTHOR("Ondrej Zary "); MODULE_DESCRIPTION("C-Media CMI8328"); MODULE_LICENSE("GPL"); -#if defined(CONFIG_GAMEPORT) || defined(CONFIG_GAMEPORT_MODULE) +#if IS_ENABLED(CONFIG_GAMEPORT) #define SUPPORT_JOYSTICK 1 #endif -- cgit From a0af56de2c6defd7b0b7fec990fca819621d3c62 Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Fri, 12 May 2017 11:54:26 +0200 Subject: ALSA: sb: Use IS_REACHABLE() Replace the complex ifdef conditions with IS_REACHABLE() macro. No functional changes. Signed-off-by: Takashi Iwai --- sound/isa/sb/emu8000.c | 2 +- sound/isa/sb/sb16.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'sound/isa') 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 -- cgit From 3a84d6c940e666d85b1c58bbcda2248c54faa898 Mon Sep 17 00:00:00 2001 From: Bhumika Goyal Date: Wed, 17 May 2017 17:08:56 +0530 Subject: ALSA: sound/isa: constify snd_kcontrol_new structures Declare snd_kcontrol_new structures as const as they are only passed an argument to the function snd_ctl_new1. This argument is of type const, so snd_kcontrol_new structures having this property can be made const. Done using Coccinelle: @r disable optional_qualifier@ identifier x; position p; @@ static struct snd_kcontrol_new x@p={...}; @ok@ identifier r.x; position p; @@ snd_ctl_new1(&x@p,...) @bad@ position p != {r.p,ok.p}; identifier r.x; @@ x@p @depends on !bad disable optional_qualifier@ identifier r.x; @@ +const struct snd_kcontrol_new x; Signed-off-by: Bhumika Goyal Signed-off-by: Takashi Iwai --- sound/isa/gus/gus_main.c | 2 +- sound/isa/gus/gus_pcm.c | 4 ++-- sound/isa/sb/sb16_csp.c | 4 ++-- sound/isa/sb/sb16_main.c | 2 +- sound/isa/sscape.c | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) (limited to 'sound/isa') diff --git a/sound/isa/gus/gus_main.c b/sound/isa/gus/gus_main.c index 4490ee442ff4..3cf9b13c780a 100644 --- a/sound/isa/gus/gus_main.c +++ b/sound/isa/gus/gus_main.c @@ -82,7 +82,7 @@ static int snd_gus_joystick_put(struct snd_kcontrol *kcontrol, struct snd_ctl_el return change; } -static struct snd_kcontrol_new snd_gus_joystick_control = { +static const struct snd_kcontrol_new snd_gus_joystick_control = { .iface = SNDRV_CTL_ELEM_IFACE_CARD, .name = "Joystick Speed", .info = snd_gus_joystick_info, diff --git a/sound/isa/gus/gus_pcm.c b/sound/isa/gus/gus_pcm.c index 06505999155f..33c1891f469a 100644 --- a/sound/isa/gus/gus_pcm.c +++ b/sound/isa/gus/gus_pcm.c @@ -809,7 +809,7 @@ static int snd_gf1_pcm_volume_put(struct snd_kcontrol *kcontrol, struct snd_ctl_ return change; } -static struct snd_kcontrol_new snd_gf1_pcm_volume_control = +static const struct snd_kcontrol_new snd_gf1_pcm_volume_control = { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = "PCM Playback Volume", @@ -818,7 +818,7 @@ static struct snd_kcontrol_new snd_gf1_pcm_volume_control = .put = snd_gf1_pcm_volume_put }; -static struct snd_kcontrol_new snd_gf1_pcm_volume_control1 = +static const struct snd_kcontrol_new snd_gf1_pcm_volume_control1 = { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = "GPCM Playback Volume", diff --git a/sound/isa/sb/sb16_csp.c b/sound/isa/sb/sb16_csp.c index 48da2276683d..fa5780bb0c68 100644 --- a/sound/isa/sb/sb16_csp.c +++ b/sound/isa/sb/sb16_csp.c @@ -1029,7 +1029,7 @@ static int snd_sb_qsound_space_put(struct snd_kcontrol *kcontrol, struct snd_ctl return change; } -static struct snd_kcontrol_new snd_sb_qsound_switch = { +static const struct snd_kcontrol_new snd_sb_qsound_switch = { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = "3D Control - Switch", .info = snd_sb_qsound_switch_info, @@ -1037,7 +1037,7 @@ static struct snd_kcontrol_new snd_sb_qsound_switch = { .put = snd_sb_qsound_switch_put }; -static struct snd_kcontrol_new snd_sb_qsound_space = { +static const struct snd_kcontrol_new snd_sb_qsound_space = { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = "3D Control - Space", .info = snd_sb_qsound_space_info, diff --git a/sound/isa/sb/sb16_main.c b/sound/isa/sb/sb16_main.c index 8b2d6c6bfe97..4be1350f6649 100644 --- a/sound/isa/sb/sb16_main.c +++ b/sound/isa/sb/sb16_main.c @@ -737,7 +737,7 @@ static int snd_sb16_dma_control_put(struct snd_kcontrol *kcontrol, struct snd_ct return change; } -static struct snd_kcontrol_new snd_sb16_dma_control = { +static const struct snd_kcontrol_new snd_sb16_dma_control = { .iface = SNDRV_CTL_ELEM_IFACE_CARD, .name = "16-bit DMA Allocation", .info = snd_sb16_dma_control_info, diff --git a/sound/isa/sscape.c b/sound/isa/sscape.c index 54f5758a1bb3..1cd2908e4f12 100644 --- a/sound/isa/sscape.c +++ b/sound/isa/sscape.c @@ -671,7 +671,7 @@ __skip_change: return change; } -static struct snd_kcontrol_new midi_mixer_ctl = { +static const struct snd_kcontrol_new midi_mixer_ctl = { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = "MIDI", .info = sscape_midi_info, -- cgit From 097a7fe369421347405d448a5ee1d37087cad4ad Mon Sep 17 00:00:00 2001 From: Takashi Sakamoto Date: Tue, 23 May 2017 22:40:20 +0900 Subject: ALSA: gus: remove unused local flag ALSA driver series for devices of Gravis Ultra Sound includes local variable 'snd_gf1_pcm_use_dma'. Although this is a flag to change behaviours of local implementations for 'struct snd_pcm_ops.copy' and 'struct snd_pcm_ops.silence', it's invariable during module lifetime. This commit removes this local variable and the relevant operations. Signed-off-by: Takashi Sakamoto Signed-off-by: Takashi Iwai --- sound/isa/gus/gus_pcm.c | 49 ++++++++++++++++++++++--------------------------- 1 file changed, 22 insertions(+), 27 deletions(-) (limited to 'sound/isa') diff --git a/sound/isa/gus/gus_pcm.c b/sound/isa/gus/gus_pcm.c index 33c1891f469a..0cc3f272edf1 100644 --- a/sound/isa/gus/gus_pcm.c +++ b/sound/isa/gus/gus_pcm.c @@ -61,8 +61,6 @@ struct gus_pcm_private { int final_volume; }; -static int snd_gf1_pcm_use_dma = 1; - static void snd_gf1_pcm_block_change_ack(struct snd_gus_card * gus, void *private_data) { struct gus_pcm_private *pcmp = private_data; @@ -363,7 +361,9 @@ static int snd_gf1_pcm_playback_copy(struct snd_pcm_substream *substream, { struct snd_pcm_runtime *runtime = substream->runtime; struct gus_pcm_private *pcmp = runtime->private_data; + struct snd_gus_card *gus = pcmp->gus; unsigned int bpos, len; + int w16, invert; bpos = samples_to_bytes(runtime, pos) + (voice * (pcmp->dma_size / 2)); len = samples_to_bytes(runtime, count); @@ -373,18 +373,14 @@ static int snd_gf1_pcm_playback_copy(struct snd_pcm_substream *substream, return -EIO; if (copy_from_user(runtime->dma_area + bpos, src, len)) return -EFAULT; - if (snd_gf1_pcm_use_dma && len > 32) { - return snd_gf1_pcm_block_change(substream, bpos, pcmp->memory + bpos, len); - } else { - struct snd_gus_card *gus = pcmp->gus; - int err, w16, invert; - - w16 = (snd_pcm_format_width(runtime->format) == 16); - invert = snd_pcm_format_unsigned(runtime->format); - if ((err = snd_gf1_pcm_poke_block(gus, runtime->dma_area + bpos, pcmp->memory + bpos, len, w16, invert)) < 0) - return err; - } - return 0; + if (len > 32) + return snd_gf1_pcm_block_change(substream, bpos, + pcmp->memory + bpos, len); + + w16 = (snd_pcm_format_width(runtime->format) == 16); + invert = snd_pcm_format_unsigned(runtime->format); + return snd_gf1_pcm_poke_block(gus, runtime->dma_area + bpos, + pcmp->memory + bpos, len, w16, invert); } static int snd_gf1_pcm_playback_silence(struct snd_pcm_substream *substream, @@ -394,7 +390,9 @@ static int snd_gf1_pcm_playback_silence(struct snd_pcm_substream *substream, { struct snd_pcm_runtime *runtime = substream->runtime; struct gus_pcm_private *pcmp = runtime->private_data; + struct snd_gus_card *gus = pcmp->gus; unsigned int bpos, len; + int w16, invert; bpos = samples_to_bytes(runtime, pos) + (voice * (pcmp->dma_size / 2)); len = samples_to_bytes(runtime, count); @@ -402,19 +400,16 @@ static int snd_gf1_pcm_playback_silence(struct snd_pcm_substream *substream, return -EIO; if (snd_BUG_ON(bpos + len > pcmp->dma_size)) return -EIO; - snd_pcm_format_set_silence(runtime->format, runtime->dma_area + bpos, count); - if (snd_gf1_pcm_use_dma && len > 32) { - return snd_gf1_pcm_block_change(substream, bpos, pcmp->memory + bpos, len); - } else { - struct snd_gus_card *gus = pcmp->gus; - int err, w16, invert; - - w16 = (snd_pcm_format_width(runtime->format) == 16); - invert = snd_pcm_format_unsigned(runtime->format); - if ((err = snd_gf1_pcm_poke_block(gus, runtime->dma_area + bpos, pcmp->memory + bpos, len, w16, invert)) < 0) - return err; - } - return 0; + snd_pcm_format_set_silence(runtime->format, runtime->dma_area + bpos, + count); + if (len > 32) + return snd_gf1_pcm_block_change(substream, bpos, + pcmp->memory + bpos, len); + + w16 = (snd_pcm_format_width(runtime->format) == 16); + invert = snd_pcm_format_unsigned(runtime->format); + return snd_gf1_pcm_poke_block(gus, runtime->dma_area + bpos, + pcmp->memory + bpos, len, w16, invert); } static int snd_gf1_pcm_playback_hw_params(struct snd_pcm_substream *substream, -- cgit From 6dbaf8b913f2976ee776beb7c8bb0c52c7066ced Mon Sep 17 00:00:00 2001 From: Takashi Sakamoto Date: Tue, 23 May 2017 22:40:42 +0900 Subject: ALSA: sb: remove needless evaluation in implementation for copy callback In design of ALSA pcm core, 'struct snd_pcm_ops.copy' is expected to copy PCM frames, according to frame alignment on intermediate buffer for userspace and dedicated buffer for data transmission. In this callback, value of 'channel' argument depends on the frame alignment, which drivers registers to runtime of PCM substream. When target devices can handle non-interleaved buffer, this value has positive value, otherwise negative. ALSA driver for PCM component of EMU8000 chip is programmed with local macro to switch the frame alignment. The 'copy' operation in non-interleaved side has evaluation of the 'channel' argument (actually it's 'voice' argument). This is useless. This commit remove the evaluation. [tiwai: the negative channel argument was the inheritance from the old code where -1 was meant for interleaved mode. The mix-up was dropped meanwhile, thus it's correct to assume that we receive no longer -1 there, and it's safe to cleanup the relevant code. Also, voice=0 for channel==1 is trivial, and it can be dropped, too.] Signed-off-by: Takashi Sakamoto Signed-off-by: Takashi Iwai --- sound/isa/sb/emu8000_pcm.c | 28 +++------------------------- 1 file changed, 3 insertions(+), 25 deletions(-) (limited to 'sound/isa') diff --git a/sound/isa/sb/emu8000_pcm.c b/sound/isa/sb/emu8000_pcm.c index 32f234f494e5..c480024422af 100644 --- a/sound/isa/sb/emu8000_pcm.c +++ b/sound/isa/sb/emu8000_pcm.c @@ -450,20 +450,8 @@ static int emu8k_pcm_copy(struct snd_pcm_substream *subs, struct snd_emu8000 *emu = rec->emu; snd_emu8000_write_wait(emu, 1); - if (voice == -1) { - unsigned short *buf = src; - int i, err; - count /= rec->voices; - for (i = 0; i < rec->voices; i++) { - err = emu8k_transfer_block(emu, pos + rec->loop_start[i], buf, count); - if (err < 0) - return err; - buf += count; - } - return 0; - } else { - return emu8k_transfer_block(emu, pos + rec->loop_start[voice], src, count); - } + return emu8k_transfer_block(emu, pos + rec->loop_start[voice], src, + count); } /* make a channel block silence */ @@ -487,17 +475,7 @@ static int emu8k_pcm_silence(struct snd_pcm_substream *subs, struct snd_emu8000 *emu = rec->emu; snd_emu8000_write_wait(emu, 1); - if (voice == -1 && rec->voices == 1) - voice = 0; - if (voice == -1) { - int err; - err = emu8k_silence_block(emu, pos + rec->loop_start[0], count / 2); - if (err < 0) - return err; - return emu8k_silence_block(emu, pos + rec->loop_start[1], count / 2); - } else { - return emu8k_silence_block(emu, pos + rec->loop_start[voice], count); - } + return emu8k_silence_block(emu, pos + rec->loop_start[voice], count); } #else /* interleave */ -- cgit From a6970bb1dd996943fce8c975282c7146fd69f560 Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Wed, 10 May 2017 20:33:05 +0200 Subject: ALSA: gus: Convert to the new PCM ops Replace the copy and the silence ops with the new PCM ops. For simplifying the code a bit, two local helpers are introduced here: get_bpos() and playback_copy_ack(). Reviewed-by: Takashi Sakamoto Signed-off-by: Takashi Iwai --- sound/isa/gus/gus_pcm.c | 97 ++++++++++++++++++++++++++++++------------------- 1 file changed, 59 insertions(+), 38 deletions(-) (limited to 'sound/isa') diff --git a/sound/isa/gus/gus_pcm.c b/sound/isa/gus/gus_pcm.c index 0cc3f272edf1..b9f6dcbef889 100644 --- a/sound/isa/gus/gus_pcm.c +++ b/sound/isa/gus/gus_pcm.c @@ -353,26 +353,25 @@ static int snd_gf1_pcm_poke_block(struct snd_gus_card *gus, unsigned char *buf, return 0; } -static int snd_gf1_pcm_playback_copy(struct snd_pcm_substream *substream, - int voice, - snd_pcm_uframes_t pos, - void __user *src, - snd_pcm_uframes_t count) +static int get_bpos(struct gus_pcm_private *pcmp, int voice, unsigned int pos, + unsigned int len) { - struct snd_pcm_runtime *runtime = substream->runtime; - struct gus_pcm_private *pcmp = runtime->private_data; - struct snd_gus_card *gus = pcmp->gus; - unsigned int bpos, len; - int w16, invert; - - bpos = samples_to_bytes(runtime, pos) + (voice * (pcmp->dma_size / 2)); - len = samples_to_bytes(runtime, count); + unsigned int bpos = pos + (voice * (pcmp->dma_size / 2)); if (snd_BUG_ON(bpos > pcmp->dma_size)) return -EIO; if (snd_BUG_ON(bpos + len > pcmp->dma_size)) return -EIO; - if (copy_from_user(runtime->dma_area + bpos, src, len)) - return -EFAULT; + return bpos; +} + +static int playback_copy_ack(struct snd_pcm_substream *substream, + unsigned int bpos, unsigned int len) +{ + struct snd_pcm_runtime *runtime = substream->runtime; + struct gus_pcm_private *pcmp = runtime->private_data; + struct snd_gus_card *gus = pcmp->gus; + int w16, invert; + if (len > 32) return snd_gf1_pcm_block_change(substream, bpos, pcmp->memory + bpos, len); @@ -383,33 +382,54 @@ static int snd_gf1_pcm_playback_copy(struct snd_pcm_substream *substream, pcmp->memory + bpos, len, w16, invert); } +static int snd_gf1_pcm_playback_copy(struct snd_pcm_substream *substream, + int voice, unsigned long pos, + void __user *src, unsigned long count) +{ + struct snd_pcm_runtime *runtime = substream->runtime; + struct gus_pcm_private *pcmp = runtime->private_data; + unsigned int len = count; + int bpos; + + bpos = get_bpos(pcmp, voice, pos, len); + if (bpos < 0) + return pos; + if (copy_from_user(runtime->dma_area + bpos, src, len)) + return -EFAULT; + return playback_copy_ack(substream, bpos, len); +} + +static int snd_gf1_pcm_playback_copy_kernel(struct snd_pcm_substream *substream, + int voice, unsigned long pos, + void *src, unsigned long count) +{ + struct snd_pcm_runtime *runtime = substream->runtime; + struct gus_pcm_private *pcmp = runtime->private_data; + unsigned int len = count; + int bpos; + + bpos = get_bpos(pcmp, voice, pos, len); + if (bpos < 0) + return pos; + memcpy(runtime->dma_area + bpos, src, len); + return playback_copy_ack(substream, bpos, len); +} + static int snd_gf1_pcm_playback_silence(struct snd_pcm_substream *substream, - int voice, - snd_pcm_uframes_t pos, - snd_pcm_uframes_t count) + int voice, unsigned long pos, + unsigned long count) { struct snd_pcm_runtime *runtime = substream->runtime; struct gus_pcm_private *pcmp = runtime->private_data; - struct snd_gus_card *gus = pcmp->gus; - unsigned int bpos, len; - int w16, invert; + unsigned int len = count; + int bpos; - bpos = samples_to_bytes(runtime, pos) + (voice * (pcmp->dma_size / 2)); - len = samples_to_bytes(runtime, count); - if (snd_BUG_ON(bpos > pcmp->dma_size)) - return -EIO; - if (snd_BUG_ON(bpos + len > pcmp->dma_size)) - return -EIO; + bpos = get_bpos(pcmp, voice, pos, len); + if (bpos < 0) + return pos; snd_pcm_format_set_silence(runtime->format, runtime->dma_area + bpos, - count); - if (len > 32) - return snd_gf1_pcm_block_change(substream, bpos, - pcmp->memory + bpos, len); - - w16 = (snd_pcm_format_width(runtime->format) == 16); - invert = snd_pcm_format_unsigned(runtime->format); - return snd_gf1_pcm_poke_block(gus, runtime->dma_area + bpos, - pcmp->memory + bpos, len, w16, invert); + bytes_to_samples(runtime, count)); + return playback_copy_ack(substream, bpos, len); } static int snd_gf1_pcm_playback_hw_params(struct snd_pcm_substream *substream, @@ -831,8 +851,9 @@ static struct snd_pcm_ops snd_gf1_pcm_playback_ops = { .prepare = snd_gf1_pcm_playback_prepare, .trigger = snd_gf1_pcm_playback_trigger, .pointer = snd_gf1_pcm_playback_pointer, - .copy = snd_gf1_pcm_playback_copy, - .silence = snd_gf1_pcm_playback_silence, + .copy_user = snd_gf1_pcm_playback_copy, + .copy_kernel = snd_gf1_pcm_playback_copy_kernel, + .fill_silence = snd_gf1_pcm_playback_silence, }; static struct snd_pcm_ops snd_gf1_pcm_capture_ops = { -- cgit From 4b83eff81c817d7e4c75605670320722611315b9 Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Wed, 10 May 2017 20:34:45 +0200 Subject: ALSA: sb: Convert to the new PCM ops Replace the copy and the silence ops with the new PCM ops. For avoiding the code redundancy, slightly hackish macros are introduced. Reviewed-by: Takashi Sakamoto Signed-off-by: Takashi Iwai --- sound/isa/sb/emu8000_pcm.c | 190 ++++++++++++++++++++++++++------------------- 1 file changed, 109 insertions(+), 81 deletions(-) (limited to 'sound/isa') diff --git a/sound/isa/sb/emu8000_pcm.c b/sound/isa/sb/emu8000_pcm.c index c480024422af..2ee8d67871ec 100644 --- a/sound/isa/sb/emu8000_pcm.c +++ b/sound/isa/sb/emu8000_pcm.c @@ -422,121 +422,148 @@ do { \ return -EAGAIN;\ } while (0) +enum { + COPY_USER, COPY_KERNEL, FILL_SILENCE, +}; + +#define GET_VAL(sval, buf, mode) \ + do { \ + switch (mode) { \ + case FILL_SILENCE: \ + sval = 0; \ + break; \ + case COPY_KERNEL: \ + sval = *buf++; \ + break; \ + default: \ + if (get_user(sval, (unsigned short __user *)buf)) \ + return -EFAULT; \ + buf++; \ + break; \ + } \ + } while (0) #ifdef USE_NONINTERLEAVE -/* copy one channel block */ -static int emu8k_transfer_block(struct snd_emu8000 *emu, int offset, unsigned short *buf, int count) -{ - EMU8000_SMALW_WRITE(emu, offset); - while (count > 0) { - unsigned short sval; - CHECK_SCHEDULER(); - if (get_user(sval, buf)) - return -EFAULT; - EMU8000_SMLD_WRITE(emu, sval); - buf++; - count--; - } - return 0; -} +#define LOOP_WRITE(rec, offset, _buf, count, mode) \ + do { \ + struct snd_emu8000 *emu = (rec)->emu; \ + unsigned short *buf = (unsigned short *)(_buf); \ + snd_emu8000_write_wait(emu, 1); \ + EMU8000_SMALW_WRITE(emu, offset); \ + while (count > 0) { \ + unsigned short sval; \ + CHECK_SCHEDULER(); \ + GET_VAL(sval, buf, mode); \ + EMU8000_SMLD_WRITE(emu, sval); \ + count--; \ + } \ + } while (0) + +/* copy one channel block */ static int emu8k_pcm_copy(struct snd_pcm_substream *subs, - int voice, - snd_pcm_uframes_t pos, - void *src, - snd_pcm_uframes_t count) + int voice, unsigned long pos, + void __user *src, unsigned long count) { struct snd_emu8k_pcm *rec = subs->runtime->private_data; - struct snd_emu8000 *emu = rec->emu; - snd_emu8000_write_wait(emu, 1); - return emu8k_transfer_block(emu, pos + rec->loop_start[voice], src, - count); + /* convert to word unit */ + pos = (pos << 1) + rec->loop_start[voice]; + count <<= 1; + LOOP_WRITE(rec, pos, src, count, COPY_UESR); + return 0; } -/* make a channel block silence */ -static int emu8k_silence_block(struct snd_emu8000 *emu, int offset, int count) +static int emu8k_pcm_copy_kernel(struct snd_pcm_substream *subs, + int voice, unsigned long pos, + void *src, unsigned long count) { - EMU8000_SMALW_WRITE(emu, offset); - while (count > 0) { - CHECK_SCHEDULER(); - EMU8000_SMLD_WRITE(emu, 0); - count--; - } + struct snd_emu8k_pcm *rec = subs->runtime->private_data; + + /* convert to word unit */ + pos = (pos << 1) + rec->loop_start[voice]; + count <<= 1; + LOOP_WRITE(rec, pos, src, count, COPY_KERNEL); return 0; } +/* make a channel block silence */ static int emu8k_pcm_silence(struct snd_pcm_substream *subs, - int voice, - snd_pcm_uframes_t pos, - snd_pcm_uframes_t count) + int voice, unsigned long pos, unsigned long count) { struct snd_emu8k_pcm *rec = subs->runtime->private_data; - struct snd_emu8000 *emu = rec->emu; - snd_emu8000_write_wait(emu, 1); - return emu8k_silence_block(emu, pos + rec->loop_start[voice], count); + /* convert to word unit */ + pos = (pos << 1) + rec->loop_start[voice]; + count <<= 1; + LOOP_WRITE(rec, pos, NULL, count, FILL_SILENCE); + return 0; } #else /* interleave */ +#define LOOP_WRITE(rec, pos, _buf, count, mode) \ + do { \ + struct snd_emu8000 *emu = rec->emu; \ + unsigned short *buf = (unsigned short *)(_buf); \ + snd_emu8000_write_wait(emu, 1); \ + EMU8000_SMALW_WRITE(emu, pos + rec->loop_start[0]); \ + if (rec->voices > 1) \ + EMU8000_SMARW_WRITE(emu, pos + rec->loop_start[1]); \ + while (count > 0) { \ + unsigned short sval; \ + CHECK_SCHEDULER(); \ + GET_VAL(sval, buf, mode); \ + EMU8000_SMLD_WRITE(emu, sval); \ + if (rec->voices > 1) { \ + CHECK_SCHEDULER(); \ + GET_VAL(sval, buf, mode); \ + EMU8000_SMRD_WRITE(emu, sval); \ + } \ + count--; \ + } \ + } while (0) + + /* * copy the interleaved data can be done easily by using * DMA "left" and "right" channels on emu8k engine. */ static int emu8k_pcm_copy(struct snd_pcm_substream *subs, - int voice, - snd_pcm_uframes_t pos, - void __user *src, - snd_pcm_uframes_t count) + int voice, unsigned long pos, + void __user *src, unsigned long count) { struct snd_emu8k_pcm *rec = subs->runtime->private_data; - struct snd_emu8000 *emu = rec->emu; - unsigned short __user *buf = src; - snd_emu8000_write_wait(emu, 1); - EMU8000_SMALW_WRITE(emu, pos + rec->loop_start[0]); - if (rec->voices > 1) - EMU8000_SMARW_WRITE(emu, pos + rec->loop_start[1]); - - while (count-- > 0) { - unsigned short sval; - CHECK_SCHEDULER(); - if (get_user(sval, buf)) - return -EFAULT; - EMU8000_SMLD_WRITE(emu, sval); - buf++; - if (rec->voices > 1) { - CHECK_SCHEDULER(); - if (get_user(sval, buf)) - return -EFAULT; - EMU8000_SMRD_WRITE(emu, sval); - buf++; - } - } + /* convert to frames */ + pos = bytes_to_frames(subs->runtime, pos); + count = bytes_to_frames(subs->runtime, count); + LOOP_WRITE(rec, pos, src, count, COPY_USER); + return 0; +} + +static int emu8k_pcm_copy_kernel(struct snd_pcm_substream *subs, + int voice, unsigned long pos, + void *src, unsigned long count) +{ + struct snd_emu8k_pcm *rec = subs->runtime->private_data; + + /* convert to frames */ + pos = bytes_to_frames(subs->runtime, pos); + count = bytes_to_frames(subs->runtime, count); + LOOP_WRITE(rec, pos, src, count, COPY_KERNEL); return 0; } static int emu8k_pcm_silence(struct snd_pcm_substream *subs, - int voice, - snd_pcm_uframes_t pos, - snd_pcm_uframes_t count) + int voice, unsigned long pos, unsigned long count) { struct snd_emu8k_pcm *rec = subs->runtime->private_data; - struct snd_emu8000 *emu = rec->emu; - snd_emu8000_write_wait(emu, 1); - EMU8000_SMALW_WRITE(emu, rec->loop_start[0] + pos); - if (rec->voices > 1) - EMU8000_SMARW_WRITE(emu, rec->loop_start[1] + pos); - while (count-- > 0) { - CHECK_SCHEDULER(); - EMU8000_SMLD_WRITE(emu, 0); - if (rec->voices > 1) { - CHECK_SCHEDULER(); - EMU8000_SMRD_WRITE(emu, 0); - } - } + /* convert to frames */ + pos = bytes_to_frames(subs->runtime, pos); + count = bytes_to_frames(subs->runtime, count); + LOOP_WRITE(rec, pos, NULL, count, FILL_SILENCE); return 0; } #endif @@ -652,8 +679,9 @@ static struct snd_pcm_ops emu8k_pcm_ops = { .prepare = emu8k_pcm_prepare, .trigger = emu8k_pcm_trigger, .pointer = emu8k_pcm_pointer, - .copy = emu8k_pcm_copy, - .silence = emu8k_pcm_silence, + .copy_user = emu8k_pcm_copy, + .copy_kernel = emu8k_pcm_copy_kernel, + .fill_silence = emu8k_pcm_silence, }; -- cgit From 0adaf3bea166d21dfd420b8628ca74adf15d75f8 Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Wed, 7 Jun 2017 14:12:16 +0200 Subject: ALSA: cs423x: Constify hw_constraints snd_pcm_hw_constraint_list(), *_ratnums() and *_ratdens() receive the const pointers. Constify the corresponding static objects for better hardening. Signed-off-by: Takashi Iwai --- sound/isa/cs423x/cs4236_lib.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sound/isa') diff --git a/sound/isa/cs423x/cs4236_lib.c b/sound/isa/cs423x/cs4236_lib.c index 2b7cc596f4c6..2012936f6756 100644 --- a/sound/isa/cs423x/cs4236_lib.c +++ b/sound/isa/cs423x/cs4236_lib.c @@ -138,7 +138,7 @@ static unsigned char snd_cs4236_ctrl_in(struct snd_wss *chip, unsigned char reg) #define CLOCKS 8 -static struct snd_ratnum clocks[CLOCKS] = { +static const struct snd_ratnum clocks[CLOCKS] = { { .num = 16934400, .den_min = 353, .den_max = 353, .den_step = 1 }, { .num = 16934400, .den_min = 529, .den_max = 529, .den_step = 1 }, { .num = 16934400, .den_min = 617, .den_max = 617, .den_step = 1 }, @@ -149,7 +149,7 @@ static struct snd_ratnum clocks[CLOCKS] = { { .num = 16934400/16, .den_min = 21, .den_max = 192, .den_step = 1 } }; -static struct snd_pcm_hw_constraint_ratnums hw_constraints_clocks = { +static const struct snd_pcm_hw_constraint_ratnums hw_constraints_clocks = { .nrats = CLOCKS, .rats = clocks, }; -- cgit From 4ea2bb7311deab401d01877f15c75e0803ac6257 Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Wed, 7 Jun 2017 14:15:49 +0200 Subject: ALSA: es1688: Constify hw_constraints snd_pcm_hw_constraint_list(), *_ratnums() and *_ratdens() receive the const pointers. Constify the corresponding static objects for better hardening. Signed-off-by: Takashi Iwai --- sound/isa/es1688/es1688_lib.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sound/isa') diff --git a/sound/isa/es1688/es1688_lib.c b/sound/isa/es1688/es1688_lib.c index 81cf26fa28d6..5d3df96c5e5b 100644 --- a/sound/isa/es1688/es1688_lib.c +++ b/sound/isa/es1688/es1688_lib.c @@ -290,7 +290,7 @@ static int snd_es1688_init(struct snd_es1688 * chip, int enable) */ -static struct snd_ratnum clocks[2] = { +static const struct snd_ratnum clocks[2] = { { .num = 795444, .den_min = 1, @@ -305,7 +305,7 @@ static struct snd_ratnum clocks[2] = { } }; -static struct snd_pcm_hw_constraint_ratnums hw_constraints_clocks = { +static const struct snd_pcm_hw_constraint_ratnums hw_constraints_clocks = { .nrats = 2, .rats = clocks, }; -- cgit From 21709121fb734715b4c4819aae36aad50cc88fd7 Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Wed, 7 Jun 2017 14:16:10 +0200 Subject: ALSA: es18xx: Constify hw_constraints snd_pcm_hw_constraint_list(), *_ratnums() and *_ratdens() receive the const pointers. Constify the corresponding static objects for better hardening. Signed-off-by: Takashi Iwai --- sound/isa/es18xx.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'sound/isa') diff --git a/sound/isa/es18xx.c b/sound/isa/es18xx.c index 0cabe2b8974f..ae17a6584061 100644 --- a/sound/isa/es18xx.c +++ b/sound/isa/es18xx.c @@ -369,7 +369,7 @@ static int snd_es18xx_reset_fifo(struct snd_es18xx *chip) return 0; } -static struct snd_ratnum new_clocks[2] = { +static const struct snd_ratnum new_clocks[2] = { { .num = 793800, .den_min = 1, @@ -384,12 +384,12 @@ static struct snd_ratnum new_clocks[2] = { } }; -static struct snd_pcm_hw_constraint_ratnums new_hw_constraints_clocks = { +static const struct snd_pcm_hw_constraint_ratnums new_hw_constraints_clocks = { .nrats = 2, .rats = new_clocks, }; -static struct snd_ratnum old_clocks[2] = { +static const struct snd_ratnum old_clocks[2] = { { .num = 795444, .den_min = 1, @@ -404,7 +404,7 @@ static struct snd_ratnum old_clocks[2] = { } }; -static struct snd_pcm_hw_constraint_ratnums old_hw_constraints_clocks = { +static const struct snd_pcm_hw_constraint_ratnums old_hw_constraints_clocks = { .nrats = 2, .rats = old_clocks, }; -- cgit From bfa516a109ae77dae34b69f36d09b8f9d329384b Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Wed, 7 Jun 2017 14:16:25 +0200 Subject: ALSA: gus: Constify hw_constraints snd_pcm_hw_constraint_list(), *_ratnums() and *_ratdens() receive the const pointers. Constify the corresponding static objects for better hardening. Signed-off-by: Takashi Iwai --- sound/isa/gus/gus_pcm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sound/isa') diff --git a/sound/isa/gus/gus_pcm.c b/sound/isa/gus/gus_pcm.c index b9f6dcbef889..6b3da01a93b7 100644 --- a/sound/isa/gus/gus_pcm.c +++ b/sound/isa/gus/gus_pcm.c @@ -562,14 +562,14 @@ static snd_pcm_uframes_t snd_gf1_pcm_playback_pointer(struct snd_pcm_substream * return pos; } -static struct snd_ratnum clock = { +static const struct snd_ratnum clock = { .num = 9878400/16, .den_min = 2, .den_max = 257, .den_step = 1, }; -static struct snd_pcm_hw_constraint_ratnums hw_constraints_clocks = { +static const struct snd_pcm_hw_constraint_ratnums hw_constraints_clocks = { .nrats = 1, .rats = &clock, }; -- cgit From b078bbfbb1a1083a69117bc894107cad6920a2ed Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Wed, 7 Jun 2017 14:16:34 +0200 Subject: ALSA: sb: Constify hw_constraints snd_pcm_hw_constraint_list(), *_ratnums() and *_ratdens() receive the const pointers. Constify the corresponding static objects for better hardening. Signed-off-by: Takashi Iwai --- sound/isa/sb/sb8_main.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'sound/isa') diff --git a/sound/isa/sb/sb8_main.c b/sound/isa/sb/sb8_main.c index 9043397fe62f..0f302be4fb6d 100644 --- a/sound/isa/sb/sb8_main.c +++ b/sound/isa/sb/sb8_main.c @@ -46,19 +46,19 @@ MODULE_LICENSE("GPL"); #define SB8_DEN(v) ((SB8_CLOCK + (v) / 2) / (v)) #define SB8_RATE(v) (SB8_CLOCK / SB8_DEN(v)) -static struct snd_ratnum clock = { +static const struct snd_ratnum clock = { .num = SB8_CLOCK, .den_min = 1, .den_max = 256, .den_step = 1, }; -static struct snd_pcm_hw_constraint_ratnums hw_constraints_clock = { +static const struct snd_pcm_hw_constraint_ratnums hw_constraints_clock = { .nrats = 1, .rats = &clock, }; -static struct snd_ratnum stereo_clocks[] = { +static const struct snd_ratnum stereo_clocks[] = { { .num = SB8_CLOCK, .den_min = SB8_DEN(22050), -- cgit From 7b3f477636eddcaa137b96e6c847fb466fadb19a Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Wed, 7 Jun 2017 14:16:43 +0200 Subject: ALSA: wss: Constify hw_constraints snd_pcm_hw_constraint_list(), *_ratnums() and *_ratdens() receive the const pointers. Constify the corresponding static objects for better hardening. Signed-off-by: Takashi Iwai --- sound/isa/wss/wss_lib.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sound/isa') diff --git a/sound/isa/wss/wss_lib.c b/sound/isa/wss/wss_lib.c index 913b731d2236..9f4e2e34cbe1 100644 --- a/sound/isa/wss/wss_lib.c +++ b/sound/isa/wss/wss_lib.c @@ -69,12 +69,12 @@ static unsigned char freq_bits[14] = { /* 48000 */ 0x0C | CS4231_XTAL1 }; -static unsigned int rates[14] = { +static const unsigned int rates[14] = { 5510, 6620, 8000, 9600, 11025, 16000, 18900, 22050, 27042, 32000, 33075, 37800, 44100, 48000 }; -static struct snd_pcm_hw_constraint_list hw_constraints_rates = { +static const struct snd_pcm_hw_constraint_list hw_constraints_rates = { .count = ARRAY_SIZE(rates), .list = rates, .mask = 0, -- cgit From 3d774d5ef066971aee1839150bf47d100d8e43d3 Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Fri, 9 Jun 2017 14:06:46 +0200 Subject: ALSA: seq: Allow the tristate build of OSS emulation Currently OSS sequencer emulation is tied with ALSA sequencer core, both are built in the same level; i.e. when CONFIG_SND_SEQUENCER=y, the OSS sequencer emulation is also always built-in, even though the functionality can be built as an individual module. This patch changes the rule and allows users to build snd-seq-oss module while others are built-in. Essentially, it's just a few simple changes in Kconfig and Makefile. Some driver codes like opl3 need to convert from the simple ifdef to IS_ENABLED(). But that's all. You might wonder how about the dependency: right, it can be messy, but it still works. Since we rewrote the sequencer binding with the standard bus, the driver can be bound at any time on demand. So, the synthesizer driver module can be loaded individually from the OSS emulation core before/after it. Signed-off-by: Takashi Iwai --- sound/isa/sb/emu8000_callback.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'sound/isa') diff --git a/sound/isa/sb/emu8000_callback.c b/sound/isa/sb/emu8000_callback.c index 72a9ac5efb40..d28d712f99f4 100644 --- a/sound/isa/sb/emu8000_callback.c +++ b/sound/isa/sb/emu8000_callback.c @@ -36,7 +36,7 @@ static void reset_voice(struct snd_emux *emu, int ch); static void terminate_voice(struct snd_emux_voice *vp); static void sysex(struct snd_emux *emu, char *buf, int len, int parsed, struct snd_midi_channel_set *chset); -#ifdef CONFIG_SND_SEQUENCER_OSS +#if IS_ENABLED(CONFIG_SND_SEQUENCER_OSS) static int oss_ioctl(struct snd_emux *emu, int cmd, int p1, int p2); #endif static int load_fx(struct snd_emux *emu, int type, int mode, @@ -76,7 +76,7 @@ static struct snd_emux_operators emu8000_ops = { .sample_reset = snd_emu8000_sample_reset, .load_fx = load_fx, .sysex = sysex, -#ifdef CONFIG_SND_SEQUENCER_OSS +#if IS_ENABLED(CONFIG_SND_SEQUENCER_OSS) .oss_ioctl = oss_ioctl, #endif }; @@ -477,7 +477,7 @@ sysex(struct snd_emux *emu, char *buf, int len, int parsed, struct snd_midi_chan } -#ifdef CONFIG_SND_SEQUENCER_OSS +#if IS_ENABLED(CONFIG_SND_SEQUENCER_OSS) /* * OSS ioctl callback */ -- cgit From 0181307abc1d2eb2a0dead93870bcffadddb827c Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Fri, 9 Jun 2017 14:40:18 +0200 Subject: ALSA: seq: Reorganize kconfig and build This is a slightly intensive rewrite of Kconfig and Makefile about ALSA sequencer stuff. The first major change is that the kconfig items for the sequencer are moved to sound/core/seq/Kconfig. OK, that's easy. The substantial change is that, instead of hackish top-level module selection in Makefile, we define a Kconfig item for each sequencer module. The driver that requires such sequencer components select exclusively the kconfig items. This is more straightforward and standard way. Signed-off-by: Takashi Iwai --- sound/isa/Kconfig | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'sound/isa') diff --git a/sound/isa/Kconfig b/sound/isa/Kconfig index 37adcc6cbe6b..bf1ab340e2a7 100644 --- a/sound/isa/Kconfig +++ b/sound/isa/Kconfig @@ -384,6 +384,12 @@ config SND_SBAWE To compile this driver as a module, choose M here: the module will be called snd-sbawe. +# select SEQ stuff to min(SND_SEQUENCER,SND_XXX) +config SND_SBAWE_SEQ + def_tristate SND_SEQUENCER && SND_SBAWE + select SND_SEQ_MIDI_EMUL + select SND_SEQ_VIRMIDI + config SND_SB16_CSP bool "Sound Blaster 16/AWE CSP support" depends on (SND_SB16 || SND_SBAWE) && (BROKEN || !PPC) -- cgit From 8272115578ce02566b4c6bbe45f09d0d55f4a1c6 Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Fri, 9 Jun 2017 14:57:51 +0200 Subject: ALSA: synth: Select snd-emux-synth explicitly Instead of the non-standard way to enable the build of snd-emux-synth module inside Makefile, rewrite Kconfig to select the item explicitly from each driver (sbawe and emu10k1). This is the standard way. Signed-off-by: Takashi Iwai --- sound/isa/Kconfig | 1 + 1 file changed, 1 insertion(+) (limited to 'sound/isa') diff --git a/sound/isa/Kconfig b/sound/isa/Kconfig index bf1ab340e2a7..ea8ecc5bb826 100644 --- a/sound/isa/Kconfig +++ b/sound/isa/Kconfig @@ -389,6 +389,7 @@ config SND_SBAWE_SEQ def_tristate SND_SEQUENCER && SND_SBAWE select SND_SEQ_MIDI_EMUL select SND_SEQ_VIRMIDI + select SND_SYNTH_EMUX config SND_SB16_CSP bool "Sound Blaster 16/AWE CSP support" -- cgit From 111b0cdb97d44cfe5dec1338a78ba8aff65c32e2 Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Fri, 9 Jun 2017 15:11:58 +0200 Subject: ALSA: seq: Allow the modular sequencer registration Many drivers bind the sequencer stuff in off-load by another driver module, so that it's loaded only on demand. In the current code, this mechanism doesn't work when the driver is built-in while the sequencer is module. We check with IS_REACHABLE() and enable only when the sequencer is in the same level of build. However, this is basically a overshoot. The binder code (snd-seq-device) is an individual module from the sequencer core (snd-seq), and we just have to make the former a built-in while keeping the latter a module for allowing the scenario like the above. This patch achieves that by rewriting Kconfig slightly. Now, a driver that provides the manual sequencer device binding should select CONFIG_SND_SEQ_DEVICE in a way as select SND_SEQ_DEVICE if SND_SEQUENCER != n Note that the "!=n" is needed here to avoid the influence of the sequencer core is module while the driver is built-in. Also, since rawmidi.o may be linked with snd_seq_device.o when built-in, we have to shuffle the code to make the linker happy. (the kernel linker isn't smart enough yet to handle such a case.) That is, snd_seq_device.c is moved to sound/core from sound/core/seq, as well as Makefile. Last but not least, the patch replaces the code using IS_REACHABLE() with IS_ENABLED(), since now the condition meets always when enabled. Signed-off-by: Takashi Iwai --- sound/isa/Kconfig | 1 + sound/isa/sb/emu8000.c | 2 +- sound/isa/sb/sb16.c | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) (limited to 'sound/isa') diff --git a/sound/isa/Kconfig b/sound/isa/Kconfig index ea8ecc5bb826..cb54d9c0a77f 100644 --- a/sound/isa/Kconfig +++ b/sound/isa/Kconfig @@ -377,6 +377,7 @@ config SND_SBAWE select SND_OPL3_LIB select SND_MPU401_UART select SND_SB16_DSP + select SND_SEQ_DEVICE if SND_SEQUENCER != n help Say Y here to include support for Sound Blaster AWE soundcards (including the Plug and Play version). diff --git a/sound/isa/sb/emu8000.c b/sound/isa/sb/emu8000.c index 0b5c4cf3abfa..d56973b770c7 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 IS_REACHABLE(CONFIG_SND_SEQUENCER) +#if IS_ENABLED(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 31ab09b3b049..917a93d696c3 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) && IS_REACHABLE(CONFIG_SND_SEQUENCER) +#if defined(SNDRV_SBAWE) && IS_ENABLED(CONFIG_SND_SEQUENCER) #define SNDRV_SBAWE_EMU8000 #endif -- cgit