ALSA: snd-usb: handle the bmFormats field as unsigned int
authorDaniel Mack <zonque@gmail.com>
Sun, 17 Mar 2013 12:07:24 +0000 (20:07 +0800)
committerTakashi Iwai <tiwai@suse.de>
Mon, 18 Mar 2013 07:47:04 +0000 (08:47 +0100)
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>
sound/usb/format.c
sound/usb/format.h
sound/usb/stream.c

index e831ee4238bbd79b2761c942dd900d2623f0912d..b30d6fb89b406a23b53850f8320a4796da4cc2d3 100644 (file)
@@ -43,7 +43,7 @@
  */
 static u64 parse_audio_format_i_type(struct snd_usb_audio *chip,
                                     struct audioformat *fp,
-                                    int format, void *_fmt,
+                                    unsigned int format, void *_fmt,
                                     int protocol)
 {
        int sample_width, sample_bytes;
@@ -353,7 +353,7 @@ err:
  * parse the format type I and III descriptors
  */
 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 usb_host_interface *iface)
 {
@@ -473,8 +473,9 @@ static int parse_audio_format_ii(struct snd_usb_audio *chip,
        return ret;
 }
 
-int snd_usb_parse_audio_format(struct snd_usb_audio *chip, struct audioformat *fp,
-                              int format, struct uac_format_type_i_continuous_descriptor *fmt,
+int snd_usb_parse_audio_format(struct snd_usb_audio *chip,
+                              struct audioformat *fp, unsigned int format,
+                              struct uac_format_type_i_continuous_descriptor *fmt,
                               int stream, struct usb_host_interface *iface)
 {
        int err;
index 387924f0af85de9b419440b2c043b8b9faa1a8de..6f315226f32042ea95881766d42aedfc26cf9f66 100644 (file)
@@ -2,7 +2,7 @@
 #define __USBAUDIO_FORMAT_H
 
 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,
                               int stream, struct usb_host_interface *iface);
 
index ad181d538bd9658edd79fec07d2fae125c9ebd38..ad0704656fe53bd0875271fd306f815a2ba48b65 100644 (file)
@@ -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_interface_descriptor *altsd;
        int i, altno, err, stream;
-       int format = 0, num_channels = 0;
+       unsigned int format = 0, num_channels = 0;
        struct audioformat *fp = NULL;
        int num, protocol, clock = 0;
        struct uac_format_type_i_continuous_descriptor *fmt;