]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
ALSA: scarlett2: Fix mixed declarations and code warning
authorGeoffrey D. Bennett <g@b4.vu>
Fri, 4 Oct 2024 14:28:12 +0000 (23:58 +0930)
committerTakashi Iwai <tiwai@suse.de>
Tue, 8 Oct 2024 08:11:49 +0000 (10:11 +0200)
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
sound/usb/mixer_scarlett2.c

index 003e91f9e43c775259b1015be6c550fc268c49ac..aa7c3d74ce8f1350509e933c4368487d57f88444 100644 (file)
@@ -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 */