All of lore.kernel.org
 help / color / mirror / Atom feed
From: Clemens Ladisch <clemens@ladisch.de>
To: alsa-devel@lists.sourceforge.net
Subject: [PATCH] fix usb-* compiler warnings
Date: Mon, 08 Jul 2002 10:19:36 +0200	[thread overview]
Message-ID: <3D294B18.B5DDACCD@ladisch.de> (raw)

[-- 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 */

             reply	other threads:[~2002-07-08  8:19 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-07-08  8:19 Clemens Ladisch [this message]
2002-07-08 10:22 ` [PATCH] fix usb-* compiler warnings Takashi Iwai

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3D294B18.B5DDACCD@ladisch.de \
    --to=clemens@ladisch.de \
    --cc=alsa-devel@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.