linux/sound/usb/caiaq
Eldad Zack 4ca231b2e6 ALSA: usb-audio: caiaq: fix endianness bug in snd_usb_caiaq_maschine_dispatch
Current code does this:

  be16_to_cpu(buf[i * 2] << 8 | buf[(i * 2) + 1])

Which is effectively (neglecting the index):

  be16_to_cpu(be16_to_cpu(*((u16 *) buf)))

This means the int16 in the buffer is not converted at all.

Daniel Mack confirmed that the driver works on little endian
CPUs, leading to the conclusion that the device-side structure
is actually little endian.
This changes the code to use le16_to_cpu().

Caught by sparse.

Acked-by: Daniel Mack <zonque@gmail.com>
Signed-off-by: Eldad Zack <eldad@fogrefinery.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-04-30 09:19:02 +02:00
..
audio.c ALSA: USB: adjust for changed 3.8 USB API 2013-04-29 10:57:35 +02:00
audio.h ALSA: snd-usb-caiaq: rename 'dev' to 'cdev' 2013-03-04 09:57:17 +01:00
control.c ALSA: snd-usb-caiaq: switch to dev_*() logging 2013-03-04 09:57:26 +01:00
control.h ALSA: snd-usb-caiaq: rename 'dev' to 'cdev' 2013-03-04 09:57:17 +01:00
device.c ALSA: snd-usb-caiaq: fix smatch warnings 2013-03-07 09:24:12 +01:00
device.h ALSA: snd-usb-caiaq: switch to dev_*() logging 2013-03-04 09:57:26 +01:00
input.c ALSA: usb-audio: caiaq: fix endianness bug in snd_usb_caiaq_maschine_dispatch 2013-04-30 09:19:02 +02:00
input.h ALSA: snd-usb-caiaq: rename 'dev' to 'cdev' 2013-03-04 09:57:17 +01:00
Makefile ALSA: snd-usb-caiaq: rename files to remove redundant information in file pathes 2009-04-14 13:31:17 +02:00
midi.c ALSA: snd-usb-caiaq: switch to dev_*() logging 2013-03-04 09:57:26 +01:00
midi.h ALSA: snd-usb-caiaq: rename 'dev' to 'cdev' 2013-03-04 09:57:17 +01:00