Commit 2fcdb06d authored by Daniel Mack's avatar Daniel Mack Committed by Takashi Iwai

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: default avatarDaniel Mack <zonque@gmail.com>
Reported-by: default avatarAndreas Koch <andreas@akdesigninc.com>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 59ea586f
...@@ -43,7 +43,7 @@ ...@@ -43,7 +43,7 @@
*/ */
static u64 parse_audio_format_i_type(struct snd_usb_audio *chip, static u64 parse_audio_format_i_type(struct snd_usb_audio *chip,
struct audioformat *fp, struct audioformat *fp,
int format, void *_fmt, unsigned int format, void *_fmt,
int protocol) int protocol)
{ {
int sample_width, sample_bytes; int sample_width, sample_bytes;
...@@ -353,7 +353,7 @@ static int parse_audio_format_rates_v2(struct snd_usb_audio *chip, ...@@ -353,7 +353,7 @@ static int parse_audio_format_rates_v2(struct snd_usb_audio *chip,
* parse the format type I and III descriptors * parse the format type I and III descriptors
*/ */
static int parse_audio_format_i(struct snd_usb_audio *chip, static int parse_audio_format_i(struct snd_usb_audio *chip,
struct audioformat *fp, int format, struct audioformat *fp, unsigned int format,
struct uac_format_type_i_continuous_descriptor *fmt, struct uac_format_type_i_continuous_descriptor *fmt,
struct usb_host_interface *iface) struct usb_host_interface *iface)
{ {
...@@ -473,8 +473,9 @@ static int parse_audio_format_ii(struct snd_usb_audio *chip, ...@@ -473,8 +473,9 @@ static int parse_audio_format_ii(struct snd_usb_audio *chip,
return ret; return ret;
} }
int snd_usb_parse_audio_format(struct snd_usb_audio *chip, struct audioformat *fp, int snd_usb_parse_audio_format(struct snd_usb_audio *chip,
int format, struct uac_format_type_i_continuous_descriptor *fmt, struct audioformat *fp, unsigned int format,
struct uac_format_type_i_continuous_descriptor *fmt,
int stream, struct usb_host_interface *iface) int stream, struct usb_host_interface *iface)
{ {
int err; int err;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
#define __USBAUDIO_FORMAT_H #define __USBAUDIO_FORMAT_H
int snd_usb_parse_audio_format(struct snd_usb_audio *chip, int snd_usb_parse_audio_format(struct snd_usb_audio *chip,
struct audioformat *fp, int format, struct audioformat *fp, unsigned int format,
struct uac_format_type_i_continuous_descriptor *fmt, struct uac_format_type_i_continuous_descriptor *fmt,
int stream, struct usb_host_interface *iface); int stream, struct usb_host_interface *iface);
......
...@@ -463,7 +463,7 @@ int snd_usb_parse_audio_interface(struct snd_usb_audio *chip, int iface_no) ...@@ -463,7 +463,7 @@ int snd_usb_parse_audio_interface(struct snd_usb_audio *chip, int iface_no)
struct usb_host_interface *alts; struct usb_host_interface *alts;
struct usb_interface_descriptor *altsd; struct usb_interface_descriptor *altsd;
int i, altno, err, stream; int i, altno, err, stream;
int format = 0, num_channels = 0; unsigned int format = 0, num_channels = 0;
struct audioformat *fp = NULL; struct audioformat *fp = NULL;
int num, protocol, clock = 0; int num, protocol, clock = 0;
struct uac_format_type_i_continuous_descriptor *fmt; struct uac_format_type_i_continuous_descriptor *fmt;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment