summaryrefslogtreecommitdiffstats
path: root/sound/usb
diff options
context:
space:
mode:
authorGeoffrey D. Bennett <g@b4.vu>2024-10-04 16:28:12 +0200
committerTakashi Iwai <tiwai@suse.de>2024-10-08 10:11:49 +0200
commit5c293089af7de1393af9efd2eb3354b10703670e (patch)
treeb07ecea06044e2c8179ce93ed1485e2cb92ae82e /sound/usb
parentALSA: scarlett2: Fix redeclaration of loop variable (diff)
downloadlinux-5c293089af7de1393af9efd2eb3354b10703670e.tar.xz
linux-5c293089af7de1393af9efd2eb3354b10703670e.zip
ALSA: scarlett2: Fix mixed declarations and code warning
In scarlett2_compressor_ctl_put(), move the declaration of param to the beginning of the function to avoid mixed declarations and code. Signed-off-by: Geoffrey D. Bennett <g@b4.vu> Signed-off-by: Takashi Iwai <tiwai@suse.de> Link: https://patch.msgid.link/ede84092737fa2ca7e94371135cc1e42f1731e84.1727971672.git.g@b4.vu
Diffstat (limited to 'sound/usb')
-rw-r--r--sound/usb/mixer_scarlett2.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sound/usb/mixer_scarlett2.c b/sound/usb/mixer_scarlett2.c
index 003e91f9e43c..aa7c3d74ce8f 100644
--- a/sound/usb/mixer_scarlett2.c
+++ b/sound/usb/mixer_scarlett2.c
@@ -5385,6 +5385,8 @@ static int scarlett2_compressor_ctl_put(
int index = elem->control;
int channel = index / SCARLETT2_COMPRESSOR_PARAM_COUNT;
int param_index = index % SCARLETT2_COMPRESSOR_PARAM_COUNT;
+ const struct compressor_param *param = &compressor_params[param_index];
+
int oval, val, err;
s32 scaled_val;
@@ -5406,8 +5408,6 @@ static int scarlett2_compressor_ctl_put(
private->compressor_values[index] = val;
- const struct compressor_param *param = &compressor_params[param_index];
-
scaled_val = val << param->scale_bits;
/* Send change to the device */