Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ALSA: snd-usb: handle the bmFormats field as unsigned int

This field may use up to 32 bits, so it should be handled as unsigned
int.

Signed-off-by: Daniel Mack <zonque@gmail.com>
Reported-by: Andreas Koch <andreas@akdesigninc.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>

authored by

Daniel Mack and committed by
Takashi Iwai
2fcdb06d 59ea586f

+7 -6
+5 -4
sound/usb/format.c
··· 43 43 */ 44 44 static u64 parse_audio_format_i_type(struct snd_usb_audio *chip, 45 45 struct audioformat *fp, 46 - int format, void *_fmt, 46 + unsigned int format, void *_fmt, 47 47 int protocol) 48 48 { 49 49 int sample_width, sample_bytes; ··· 353 353 * parse the format type I and III descriptors 354 354 */ 355 355 static int parse_audio_format_i(struct snd_usb_audio *chip, 356 - struct audioformat *fp, int format, 356 + struct audioformat *fp, unsigned int format, 357 357 struct uac_format_type_i_continuous_descriptor *fmt, 358 358 struct usb_host_interface *iface) 359 359 { ··· 473 473 return ret; 474 474 } 475 475 476 - int snd_usb_parse_audio_format(struct snd_usb_audio *chip, struct audioformat *fp, 477 - int format, struct uac_format_type_i_continuous_descriptor *fmt, 476 + int snd_usb_parse_audio_format(struct snd_usb_audio *chip, 477 + struct audioformat *fp, unsigned int format, 478 + struct uac_format_type_i_continuous_descriptor *fmt, 478 479 int stream, struct usb_host_interface *iface) 479 480 { 480 481 int err;
+1 -1
sound/usb/format.h
··· 2 2 #define __USBAUDIO_FORMAT_H 3 3 4 4 int snd_usb_parse_audio_format(struct snd_usb_audio *chip, 5 - struct audioformat *fp, int format, 5 + struct audioformat *fp, unsigned int format, 6 6 struct uac_format_type_i_continuous_descriptor *fmt, 7 7 int stream, struct usb_host_interface *iface); 8 8
+1 -1
sound/usb/stream.c
··· 463 463 struct usb_host_interface *alts; 464 464 struct usb_interface_descriptor *altsd; 465 465 int i, altno, err, stream; 466 - int format = 0, num_channels = 0; 466 + unsigned int format = 0, num_channels = 0; 467 467 struct audioformat *fp = NULL; 468 468 int num, protocol, clock = 0; 469 469 struct uac_format_type_i_continuous_descriptor *fmt;