summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sound/usb/mixer_scarlett_gen2.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/sound/usb/mixer_scarlett_gen2.c b/sound/usb/mixer_scarlett_gen2.c
index 346551599dd6..f9d698a37153 100644
--- a/sound/usb/mixer_scarlett_gen2.c
+++ b/sound/usb/mixer_scarlett_gen2.c
@@ -1177,6 +1177,7 @@ static int scarlett2_usb_get_config(
const struct scarlett2_config *config_item =
&scarlett2_config_items[info->has_mixer][config_item_num];
int size, err, i;
+ u8 *buf_8;
u8 value;
/* For byte-sized parameters, retrieve directly into buf */
@@ -1185,9 +1186,12 @@ static int scarlett2_usb_get_config(
err = scarlett2_usb_get(mixer, config_item->offset, buf, size);
if (err < 0)
return err;
- if (size == 2)
- for (i = 0; i < count; i++, (u16 *)buf++)
- *(u16 *)buf = le16_to_cpu(*(__le16 *)buf);
+ if (size == 2) {
+ u16 *buf_16 = buf;
+
+ for (i = 0; i < count; i++, buf_16++)
+ *buf_16 = le16_to_cpu(*(__le16 *)buf_16);
+ }
return 0;
}
@@ -1197,8 +1201,9 @@ static int scarlett2_usb_get_config(
return err;
/* then unpack from value into buf[] */
+ buf_8 = buf;
for (i = 0; i < 8 && i < count; i++, value >>= 1)
- *(u8 *)buf++ = value & 1;
+ *buf_8++ = value & 1;
return 0;
}