Skip to contentSkip to conversation

ALSA: scarlett2: Convert meter levels from little-endian

PATCH Applied Geoffrey D. Bennett 2 participants 2 messages Dec 26, 2023 – Dec 29, 2023

Subsystems (2)
lore
Share & tools
lore

Geoffrey D. Bennett

author maintainer
#0 lore raw

PATCH 1/1 ALSA: scarlett2: Convert meter levels from little-endian

Add missing conversion from little-endian data to CPU-endian in scarlett2_usb_get_meter_levels().

Fixes 3473185f31df ("ALSA: scarlett2: Remap Level Meter values")

---

Hi Takashi,

Can you add this to 6.7-rc8 please.

Thanks,
Geoffrey.

 sound/usb/mixer_scarlett2.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
sound/usb/mixer_scarlett2.c +2 -2
index e25f004e50e4..e5d8543f9686 100644
@@ -2110,7 +2110,7 @@ static int scarlett2_usb_get_meter_levels(struct usb_mixer_interface *mixer,
 		__le16 num_meters;
 		__le32 magic;
 	} __packed req;
-	u32 resp[SCARLETT2_MAX_METERS];
+	__le32 resp[SCARLETT2_MAX_METERS];
 	int i, err;
 
 	req.pad = 0;
@@ -2123,7 +2123,7 @@ static int scarlett2_usb_get_meter_levels(struct usb_mixer_interface *mixer,
 
 	/* copy, convert to u16 */
 	for (i = 0; i < num_meters; i++)
-		levels[i] = resp[i];
+		levels[i] = le32_to_cpu(resp[i]);
 
 	return 0;
 }
Signature · 1 line
2.43.0
Applied
#1 lore raw
Quoted 11 lines · Geoffrey D. Bennett

Add missing conversion from little-endian data to CPU-endian in scarlett2_usb_get_meter_levels().

Fixes 3473185f31df ("ALSA: scarlett2: Remap Level Meter values")

---

Hi Takashi,

Can you add this to 6.7-rc8 please.

Applied to for-linus branch. I'm going to send a PR for 6.7 final in the next week.

thanks,

Takashi