* [PATCH] Detailed messages in usbaudio.c
@ 2009-01-24 19:40 LCID Fire
2009-01-27 13:54 ` LCID Fire
0 siblings, 1 reply; 4+ messages in thread
From: LCID Fire @ 2009-01-24 19:40 UTC (permalink / raw)
To: Alsa-devel
[-- Attachment #1: Type: text/plain, Size: 114 bytes --]
Attached are 3 patches which make the error messages in usbaudio.c more
useful and also some code optimizations.
[-- Attachment #2: commit-191cf81 --]
[-- Type: text/plain, Size: 794 bytes --]
commit 191cf816a5a618a84cc3627c5f9f96355f5d22c4
Author: Andreas Bergmeier <lcid-fire@gmx.net>
Date: Sat Jan 24 12:17:01 2009 +0100
Print device number which did not support low speed audio streaming
Signed-off-by: Andreas Bergmeier <lcid-fire@gmx.net>
diff --git a/sound/usb/usbaudio.c b/sound/usb/usbaudio.c
index 8b8eb9e..2cfb8a3 100644
--- a/sound/usb/usbaudio.c
+++ b/sound/usb/usbaudio.c
@@ -2929,7 +2929,7 @@ static int snd_usb_create_streams(struct snd_usb_audio *chip, int ctrlif)
continue;
}
if (snd_usb_get_speed(dev) == USB_SPEED_LOW) {
- snd_printk(KERN_ERR "low speed audio streaming not supported\n");
+ snd_printk(KERN_ERR "%d: low speed audio streaming not supported\n", dev->devnum);
continue;
}
if (! parse_audio_endpoints(chip, j)) {
[-- Attachment #3: commit-c6d62cb --]
[-- Type: text/plain, Size: 768 bytes --]
commit c6d62cbaf6d36b252768ef109b8d85a036e1d451
Author: Andreas Bergmeier <lcid-fire@gmx.net>
Date: Sat Jan 24 12:16:16 2009 +0100
Replaced 'return NULL' lines by break in snd_usb_find_desc so there is only one default error.
Signed-off-by: Andreas Bergmeier <lcid-fire@gmx.net>
diff --git a/sound/usb/usbaudio.c b/sound/usb/usbaudio.c
index d35b51c..8b8eb9e 100644
--- a/sound/usb/usbaudio.c
+++ b/sound/usb/usbaudio.c
@@ -2054,10 +2054,10 @@ void *snd_usb_find_desc(void *descstart, int desclen, void *after, u8 dtype)
end = p + desclen;
for (; p < end;) {
if (p[0] < 2)
- return NULL;
+ break;
next = p + p[0];
if (next > end)
- return NULL;
+ break;
if (p[1] == dtype && (!after || (void *)p > after)) {
return p;
}
[-- Attachment #4: commit-cd01803 --]
[-- Type: text/plain, Size: 1052 bytes --]
commit cd0180399253b17ece4fc1177457b21b8b70fe8f
Author: Andreas Bergmeier <lcid-fire@gmx.net>
Date: Sat Jan 24 12:22:13 2009 +0100
Add device and control number so it's apparent for which control this error is showing up.
Signed-off-by: Andreas Bergmeier <lcid-fire@gmx.net>
diff --git a/sound/usb/usbaudio.c b/sound/usb/usbaudio.c
index 037435d..e578a5c 100644
--- a/sound/usb/usbaudio.c
+++ b/sound/usb/usbaudio.c
@@ -2867,12 +2867,12 @@ static int snd_usb_create_streams(struct snd_usb_audio *chip, int ctrlif)
/* find audiocontrol interface */
host_iface = &usb_ifnum_to_if(dev, ctrlif)->altsetting[0];
if (!(p1 = snd_usb_find_csint_desc(host_iface->extra, host_iface->extralen, NULL, HEADER))) {
- snd_printk(KERN_ERR "cannot find HEADER\n");
+ snd_printk(KERN_ERR "%d:%u: cannot find HEADER\n", dev->devnum, ctrlif);
return -EINVAL;
}
if (! p1[7] || p1[0] < 8 + p1[7]) {
- snd_printk(KERN_ERR "invalid HEADER\n");
+ snd_printk(KERN_ERR "%d:%u: invalid HEADER\n", dev->devnum, ctrlif);
return -EINVAL;
}
[-- Attachment #5: Type: text/plain, Size: 160 bytes --]
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] Detailed messages in usbaudio.c
2009-01-24 19:40 [PATCH] Detailed messages in usbaudio.c LCID Fire
@ 2009-01-27 13:54 ` LCID Fire
2009-01-27 13:57 ` Takashi Iwai
2009-01-27 13:57 ` Takashi Iwai
0 siblings, 2 replies; 4+ messages in thread
From: LCID Fire @ 2009-01-27 13:54 UTC (permalink / raw)
To: Alsa-devel
[-- Attachment #1: Type: text/plain, Size: 183 bytes --]
LCID Fire wrote:
> Attached are 3 patches which make the error messages in usbaudio.c more
> useful and also some code optimizations.
Attached are the patches done via format patch.
[-- Attachment #2: 0001-Add-device-and-control-number-so-it-s-apparent-for-w.patch --]
[-- Type: text/x-patch, Size: 1178 bytes --]
>From cd0180399253b17ece4fc1177457b21b8b70fe8f Mon Sep 17 00:00:00 2001
From: Andreas Bergmeier <lcid-fire@gmx.net>
Date: Sat, 24 Jan 2009 12:22:13 +0100
Subject: [PATCH] Add device and control number so it's apparent for which control this error is showing up.
Signed-off-by: Andreas Bergmeier <lcid-fire@gmx.net>
---
sound/usb/usbaudio.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/sound/usb/usbaudio.c b/sound/usb/usbaudio.c
index 037435d..e578a5c 100644
--- a/sound/usb/usbaudio.c
+++ b/sound/usb/usbaudio.c
@@ -2867,12 +2867,12 @@ static int snd_usb_create_streams(struct snd_usb_audio *chip, int ctrlif)
/* find audiocontrol interface */
host_iface = &usb_ifnum_to_if(dev, ctrlif)->altsetting[0];
if (!(p1 = snd_usb_find_csint_desc(host_iface->extra, host_iface->extralen, NULL, HEADER))) {
- snd_printk(KERN_ERR "cannot find HEADER\n");
+ snd_printk(KERN_ERR "%d:%u: cannot find HEADER\n", dev->devnum, ctrlif);
return -EINVAL;
}
if (! p1[7] || p1[0] < 8 + p1[7]) {
- snd_printk(KERN_ERR "invalid HEADER\n");
+ snd_printk(KERN_ERR "%d:%u: invalid HEADER\n", dev->devnum, ctrlif);
return -EINVAL;
}
--
1.5.6.3
[-- Attachment #3: 0001-Print-device-number-which-did-not-support-low-speed.patch --]
[-- Type: text/x-patch, Size: 918 bytes --]
>From 191cf816a5a618a84cc3627c5f9f96355f5d22c4 Mon Sep 17 00:00:00 2001
From: Andreas Bergmeier <lcid-fire@gmx.net>
Date: Sat, 24 Jan 2009 12:17:01 +0100
Subject: [PATCH] Print device number which did not support low speed audio streaming
Signed-off-by: Andreas Bergmeier <lcid-fire@gmx.net>
---
sound/usb/usbaudio.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/sound/usb/usbaudio.c b/sound/usb/usbaudio.c
index 8b8eb9e..2cfb8a3 100644
--- a/sound/usb/usbaudio.c
+++ b/sound/usb/usbaudio.c
@@ -2929,7 +2929,7 @@ static int snd_usb_create_streams(struct snd_usb_audio *chip, int ctrlif)
continue;
}
if (snd_usb_get_speed(dev) == USB_SPEED_LOW) {
- snd_printk(KERN_ERR "low speed audio streaming not supported\n");
+ snd_printk(KERN_ERR "%d: low speed audio streaming not supported\n", dev->devnum);
continue;
}
if (! parse_audio_endpoints(chip, j)) {
--
1.5.6.3
[-- Attachment #4: 0001-Replaced-return-NULL-lines-by-break-in-snd_usb_fin.patch --]
[-- Type: text/x-patch, Size: 894 bytes --]
>From c6d62cbaf6d36b252768ef109b8d85a036e1d451 Mon Sep 17 00:00:00 2001
From: Andreas Bergmeier <lcid-fire@gmx.net>
Date: Sat, 24 Jan 2009 12:16:16 +0100
Subject: [PATCH] Replaced 'return NULL' lines by break in snd_usb_find_desc so there is only one default error.
Signed-off-by: Andreas Bergmeier <lcid-fire@gmx.net>
---
sound/usb/usbaudio.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/sound/usb/usbaudio.c b/sound/usb/usbaudio.c
index d35b51c..8b8eb9e 100644
--- a/sound/usb/usbaudio.c
+++ b/sound/usb/usbaudio.c
@@ -2054,10 +2054,10 @@ void *snd_usb_find_desc(void *descstart, int desclen, void *after, u8 dtype)
end = p + desclen;
for (; p < end;) {
if (p[0] < 2)
- return NULL;
+ break;
next = p + p[0];
if (next > end)
- return NULL;
+ break;
if (p[1] == dtype && (!after || (void *)p > after)) {
return p;
}
--
1.5.6.3
[-- Attachment #5: Type: text/plain, Size: 160 bytes --]
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] Detailed messages in usbaudio.c
2009-01-27 13:54 ` LCID Fire
@ 2009-01-27 13:57 ` Takashi Iwai
2009-01-27 13:57 ` Takashi Iwai
1 sibling, 0 replies; 4+ messages in thread
From: Takashi Iwai @ 2009-01-27 13:57 UTC (permalink / raw)
To: LCID Fire; +Cc: Alsa-devel
At Tue, 27 Jan 2009 14:54:16 +0100,
LCID Fire wrote:
>
> >From cd0180399253b17ece4fc1177457b21b8b70fe8f Mon Sep 17 00:00:00 2001
> From: Andreas Bergmeier <lcid-fire@gmx.net>
> Date: Sat, 24 Jan 2009 12:22:13 +0100
> Subject: [PATCH] Add device and control number so it's apparent for which control this error is showing up.
Please use a shorter summary line.
The detailed description should follow in the changelog.
>
> Signed-off-by: Andreas Bergmeier <lcid-fire@gmx.net>
> ---
> sound/usb/usbaudio.c | 4 ++--
> 1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/sound/usb/usbaudio.c b/sound/usb/usbaudio.c
> index 037435d..e578a5c 100644
> --- a/sound/usb/usbaudio.c
> +++ b/sound/usb/usbaudio.c
> @@ -2867,12 +2867,12 @@ static int snd_usb_create_streams(struct snd_usb_audio *chip, int ctrlif)
> /* find audiocontrol interface */
> host_iface = &usb_ifnum_to_if(dev, ctrlif)->altsetting[0];
> if (!(p1 = snd_usb_find_csint_desc(host_iface->extra, host_iface->extralen, NULL, HEADER))) {
> - snd_printk(KERN_ERR "cannot find HEADER\n");
> + snd_printk(KERN_ERR "%d:%u: cannot find HEADER\n", dev->devnum, ctrlif);
Please fold a line appropriately if it exceeds 80 chars.
>
> return -EINVAL;
> }
> if (! p1[7] || p1[0] < 8 + p1[7]) {
> - snd_printk(KERN_ERR "invalid HEADER\n");
> + snd_printk(KERN_ERR "%d:%u: invalid HEADER\n", dev->devnum, ctrlif);
Ditto.
thanks,
Takashi
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] Detailed messages in usbaudio.c
2009-01-27 13:54 ` LCID Fire
2009-01-27 13:57 ` Takashi Iwai
@ 2009-01-27 13:57 ` Takashi Iwai
1 sibling, 0 replies; 4+ messages in thread
From: Takashi Iwai @ 2009-01-27 13:57 UTC (permalink / raw)
To: LCID Fire; +Cc: Alsa-devel
At Tue, 27 Jan 2009 14:54:16 +0100,
LCID Fire wrote:
>
> LCID Fire wrote:
> > Attached are 3 patches which make the error messages in usbaudio.c more
> > useful and also some code optimizations.
> Attached are the patches done via format patch.
At the next time, please post one patch per mail.
This will make easier to review and reply.
thanks,
Takashi
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2009-01-27 13:57 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-24 19:40 [PATCH] Detailed messages in usbaudio.c LCID Fire
2009-01-27 13:54 ` LCID Fire
2009-01-27 13:57 ` Takashi Iwai
2009-01-27 13:57 ` Takashi Iwai
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.