Skip to content

Commit

Permalink
ALSA: scarlett2: Remove repeated elem->head.mixer references
Browse files Browse the repository at this point in the history
Use a local variable *mixer rather than repeating elem->header.mixer
in scarlett2_direct_monitor_ctl_get() and scarlett2_meter_ctl_get().

Signed-off-by: Geoffrey D. Bennett <[email protected]>
Signed-off-by: Takashi Iwai <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
  • Loading branch information
geoffreybennett authored and NeroReflex committed Feb 20, 2024
1 parent b244c88 commit a2df00c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions sound/usb/mixer_scarlett2.c
Original file line number Diff line number Diff line change
Expand Up @@ -3927,7 +3927,7 @@ static int scarlett2_direct_monitor_ctl_get(
{
struct usb_mixer_elem_info *elem = kctl->private_data;
struct usb_mixer_interface *mixer = elem->head.mixer;
struct scarlett2_data *private = elem->head.mixer->private_data;
struct scarlett2_data *private = mixer->private_data;
int err = 0;

mutex_lock(&private->data_mutex);
Expand Down Expand Up @@ -4191,7 +4191,8 @@ static int scarlett2_meter_ctl_get(struct snd_kcontrol *kctl,
struct snd_ctl_elem_value *ucontrol)
{
struct usb_mixer_elem_info *elem = kctl->private_data;
struct scarlett2_data *private = elem->head.mixer->private_data;
struct usb_mixer_interface *mixer = elem->head.mixer;
struct scarlett2_data *private = mixer->private_data;
u8 *meter_level_map = private->meter_level_map;
u16 meter_levels[SCARLETT2_MAX_METERS];
int i, err;
Expand All @@ -4203,7 +4204,7 @@ static int scarlett2_meter_ctl_get(struct snd_kcontrol *kctl,
goto unlock;
}

err = scarlett2_usb_get_meter_levels(elem->head.mixer, elem->channels,
err = scarlett2_usb_get_meter_levels(mixer, elem->channels,
meter_levels);
if (err < 0)
goto unlock;
Expand Down

0 comments on commit a2df00c

Please sign in to comment.