Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 09/14] ALSA: usb-audio: scarlett2: Add temp variable for consistency
@ 2021-06-20 16:46 Geoffrey D. Bennett
  0 siblings, 0 replies; only message in thread
From: Geoffrey D. Bennett @ 2021-06-20 16:46 UTC (permalink / raw)
  To: alsa-devel, Takashi Iwai; +Cc: Hin-Tak Leung, Vladimir Sadovnikov

Add index temporary variable to scarlett2_mixer_ctl_put() for
consistency with the other *_ctl_put() functions.

Signed-off-by: Geoffrey D. Bennett <g@b4.vu>
---
 sound/usb/mixer_scarlett_gen2.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/sound/usb/mixer_scarlett_gen2.c b/sound/usb/mixer_scarlett_gen2.c
index c1e74918425a..cb8483d3c58a 100644
--- a/sound/usb/mixer_scarlett_gen2.c
+++ b/sound/usb/mixer_scarlett_gen2.c
@@ -1622,18 +1622,19 @@ static int scarlett2_mixer_ctl_put(struct snd_kcontrol *kctl,
 	const struct scarlett2_device_info *info = private->info;
 	const struct scarlett2_ports *ports = info->ports;
 	int oval, val, num_mixer_in, mix_num, err = 0;
+	int index = elem->control;
 
 	mutex_lock(&private->data_mutex);
 
-	oval = private->mix[elem->control];
+	oval = private->mix[index];
 	val = ucontrol->value.integer.value[0];
 	num_mixer_in = ports[SCARLETT2_PORT_TYPE_MIX].num[SCARLETT2_PORT_OUT];
-	mix_num = elem->control / num_mixer_in;
+	mix_num = index / num_mixer_in;
 
 	if (oval == val)
 		goto unlock;
 
-	private->mix[elem->control] = val;
+	private->mix[index] = val;
 	err = scarlett2_usb_set_mix(mixer, mix_num);
 	if (err == 0)
 		err = 1;
-- 
2.31.1


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2021-06-20 16:50 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-06-20 16:46 [PATCH 09/14] ALSA: usb-audio: scarlett2: Add temp variable for consistency Geoffrey D. Bennett

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox