* [PATCH v2] ALSA: usb-audio: Reorder snd_djm_devices[] entries
@ 2021-12-04 18:52 Geraldo Nascimento
2021-12-06 9:07 ` Takashi Iwai
0 siblings, 1 reply; 2+ messages in thread
From: Geraldo Nascimento @ 2021-12-04 18:52 UTC (permalink / raw)
To: Takashi Iwai; +Cc: William Overton, ALSA-devel, Olivia Mackintosh
Olivia Mackintosh has posted to alsa-devel reporting that
there's a potential bug that could break mixer quirks for Pioneer
devices introduced by 6d27788160362a7ee6c0d317636fe4b1ddbe59a7
"ALSA: usb-audio: Add support for the Pioneer DJM 750MK2
Mixer/Soundcard".
This happened because the DJM 750 MK2 was added last to the Pioneer DJM
device table index and defined as 0x4 but was added to snd_djm_devices[]
just after the DJM 750 (MK1) entry instead of last, after the DJM 900
NXS2. This escaped review.
To prevent that from ever happening again, Takashi Iwai suggested to use
C99 array designators in snd_djm_devices[] instead of simply reordering
the entries.
Reported-by: Olivia Mackintosh <livvy@base.nu>
Suggested-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Geraldo Nascimento <geraldogabriel@gmail.com>
---
V1 -> V2: added C99 array designators to prevent the order of entries
ever being an issue again.
---
Hi Takashi,
First, thanks for the suggestion regarding C99 array designators. This
will serve us well. As I said before, I don't own any DJM mixers to test
this, and although it's a simple change, I'm always for testing.
Thanks,
Geraldo Nascimento
---
diff --git a/sound/usb/mixer_quirks.c b/sound/usb/mixer_quirks.c
index d489c1de3bae..823b6b8de942 100644
--- a/sound/usb/mixer_quirks.c
+++ b/sound/usb/mixer_quirks.c
@@ -3016,11 +3016,11 @@ static const struct snd_djm_ctl snd_djm_ctls_750mk2[] = {
static const struct snd_djm_device snd_djm_devices[] = {
- SND_DJM_DEVICE(250mk2),
- SND_DJM_DEVICE(750),
- SND_DJM_DEVICE(750mk2),
- SND_DJM_DEVICE(850),
- SND_DJM_DEVICE(900nxs2)
+ [SND_DJM_250MK2_IDX] = SND_DJM_DEVICE(250mk2),
+ [SND_DJM_750_IDX] = SND_DJM_DEVICE(750),
+ [SND_DJM_850_IDX] = SND_DJM_DEVICE(850),
+ [SND_DJM_900NXS2_IDX] = SND_DJM_DEVICE(900nxs2),
+ [SND_DJM_750MK2_IDX] = SND_DJM_DEVICE(750mk2),
};
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH v2] ALSA: usb-audio: Reorder snd_djm_devices[] entries
2021-12-04 18:52 [PATCH v2] ALSA: usb-audio: Reorder snd_djm_devices[] entries Geraldo Nascimento
@ 2021-12-06 9:07 ` Takashi Iwai
0 siblings, 0 replies; 2+ messages in thread
From: Takashi Iwai @ 2021-12-06 9:07 UTC (permalink / raw)
To: Geraldo Nascimento; +Cc: William Overton, ALSA-devel, Olivia Mackintosh
On Sat, 04 Dec 2021 19:52:24 +0100,
Geraldo Nascimento wrote:
>
> Olivia Mackintosh has posted to alsa-devel reporting that
> there's a potential bug that could break mixer quirks for Pioneer
> devices introduced by 6d27788160362a7ee6c0d317636fe4b1ddbe59a7
> "ALSA: usb-audio: Add support for the Pioneer DJM 750MK2
> Mixer/Soundcard".
>
> This happened because the DJM 750 MK2 was added last to the Pioneer DJM
> device table index and defined as 0x4 but was added to snd_djm_devices[]
> just after the DJM 750 (MK1) entry instead of last, after the DJM 900
> NXS2. This escaped review.
>
> To prevent that from ever happening again, Takashi Iwai suggested to use
> C99 array designators in snd_djm_devices[] instead of simply reordering
> the entries.
>
> Reported-by: Olivia Mackintosh <livvy@base.nu>
> Suggested-by: Takashi Iwai <tiwai@suse.de>
> Signed-off-by: Geraldo Nascimento <geraldogabriel@gmail.com>
>
> ---
>
> V1 -> V2: added C99 array designators to prevent the order of entries
> ever being an issue again.
Thanks, applied now with Fixes tag.
Takashi
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-12-06 9:08 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-12-04 18:52 [PATCH v2] ALSA: usb-audio: Reorder snd_djm_devices[] entries Geraldo Nascimento
2021-12-06 9:07 ` Takashi Iwai
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.