All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Geoffrey D. Bennett" <g@b4.vu>
To: alsa-devel@alsa-project.org, Takashi Iwai <tiwai@suse.de>
Cc: Vladimir Sadovnikov <sadko4u@gmail.com>
Subject: [PATCH 7/8] ALSA: usb-audio: scarlett2: Add temp variable for consistency
Date: Mon, 7 Jun 2021 03:16:44 +0930	[thread overview]
Message-ID: <198b38f091b40e59d40dfafa3024c97a3ea202f0.1622999147.git.g@b4.vu> (raw)
In-Reply-To: <cover.1622999147.git.g@b4.vu>

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 81c59463b693..8a4aa16cc364 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


  parent reply	other threads:[~2021-06-06 17:48 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-06 17:44 [PATCH 0/8] ALSA: usb-audio: scarlett2: cleanup Geoffrey D. Bennett
2021-06-06 17:45 ` [PATCH 1/8] ALSA: usb-audio: scarlett2: Remove incorrect S/PDIF comment Geoffrey D. Bennett
2021-06-06 17:45 ` [PATCH 2/8] ALSA: usb-audio: scarlett2: Coding style improvements Geoffrey D. Bennett
2021-06-06 17:45 ` [PATCH 3/8] ALSA: usb-audio: scarlett2: Remove unused/useless code Geoffrey D. Bennett
2021-06-06 17:46 ` [PATCH 4/8] ALSA: usb-audio: scarlett2: Remove interrupt debug message Geoffrey D. Bennett
2021-06-06 17:46 ` [PATCH 5/8] ALSA: usb-audio: scarlett2: Rename buttons/interrupts Geoffrey D. Bennett
2021-06-06 17:46 ` [PATCH 6/8] ALSA: usb-audio: scarlett2: Rename struct scarlett2_mixer_data Geoffrey D. Bennett
2021-06-06 17:46 ` Geoffrey D. Bennett [this message]
2021-06-06 17:47 ` [PATCH 8/8] ALSA: usb-audio: scarlett2: Fix data_mutex lock Geoffrey D. Bennett

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=198b38f091b40e59d40dfafa3024c97a3ea202f0.1622999147.git.g@b4.vu \
    --to=g@b4.vu \
    --cc=alsa-devel@alsa-project.org \
    --cc=sadko4u@gmail.com \
    --cc=tiwai@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.