All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] fix usb-* compiler warnings
@ 2002-07-08  8:19 Clemens Ladisch
  2002-07-08 10:22 ` Takashi Iwai
  0 siblings, 1 reply; 2+ messages in thread
From: Clemens Ladisch @ 2002-07-08  8:19 UTC (permalink / raw)
  To: alsa-devel

[-- Attachment #1: Type: text/plain, Size: 292 bytes --]


The compiler complains that usbaudio.c doesn't use snd_enable[].
Let's make it happy ...

When using modversions, usb_alloc_urb()/_submit_urb()/_set_interface()
are defined as macros. #undef'ing them in wrapper.h before redefining
them doesn't hurt in the case they aren't macros.


Clemens

[-- Attachment #2: usb.diff --]
[-- Type: application/octet-stream, Size: 1375 bytes --]

Index: usb/usbaudio.c
===================================================================
RCS file: /cvsroot/alsa/alsa-driver/usb/usbaudio.c,v
retrieving revision 1.15
diff -u -r1.15 usbaudio.c
--- usb/usbaudio.c	5 Jul 2002 13:37:53 -0000	1.15
+++ usb/usbaudio.c	8 Jul 2002 08:08:24 -0000
@@ -1961,7 +1961,7 @@
 		 * now look for an empty slot and create a new card instance
 		 */
 		for (i = 0; i < SNDRV_CARDS; i++)
-			if (! usb_chip[i]) {
+			if (snd_enable[i] && ! usb_chip[i]) {
 				card = snd_card_new(snd_index[i], snd_id[i], THIS_MODULE, 0);
 				if (card == NULL) {
 					snd_printk(KERN_ERR "cannot create a card instance %d\n", i);
Index: usb/wrapper.h
===================================================================
RCS file: /cvsroot/alsa/alsa-driver/usb/wrapper.h,v
retrieving revision 1.2
diff -u -r1.2 wrapper.h
--- usb/wrapper.h	2 Jul 2002 17:22:29 -0000	1.2
+++ usb/wrapper.h	8 Jul 2002 08:08:24 -0000
@@ -10,6 +10,8 @@
 {
 	return usb_submit_urb(urb);
 }
+#undef usb_alloc_urb
+#undef usb_submit_urb
 #define usb_alloc_urb(n,flags) usb_alloc_urb_wrapper(n,flags)
 #define usb_submit_urb(p,flags) usb_submit_urb_wrapper(p,flags)
 #endif /* LINUX_VERSION_CODE < 2.5.0 */
@@ -82,6 +84,7 @@
 	return 0;
 }
 
+#undef usb_set_interface
 #define usb_set_interface(dev,iface,alt) hack_usb_set_interface(dev,iface,alt)
 
 #endif /* LINUX_VERSION < 2.5.24 */

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2002-07-08 10:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-07-08  8:19 [PATCH] fix usb-* compiler warnings Clemens Ladisch
2002-07-08 10:22 ` 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.