* [patch] ALSA compiler warnings fixes
@ 2002-11-18 20:53 Robert Love
2002-11-18 21:01 ` Jeff Garzik
0 siblings, 1 reply; 4+ messages in thread
From: Robert Love @ 2002-11-18 20:53 UTC (permalink / raw)
To: torvalds; +Cc: linux-kernel
Linus,
Attached patch fixes numerous warnings in ALSA core of the type "unused
variable foo" due to defined-away functions.
Usual solution applied.
Patch is against current BK, please apply.
Robert Love
Fix numerous ALSA core compiler warnings of the type "unused variable foo"
include/sound/core.h | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)
diff -urN linux-2.5.48/include/sound/core.h linux/include/sound/core.h
--- linux-2.5.48/include/sound/core.h 2002-11-17 23:29:57.000000000 -0500
+++ linux/include/sound/core.h 2002-11-18 15:51:59.000000000 -0500
@@ -177,11 +177,11 @@
wake_up(&card->power_sleep);
}
#else
-#define snd_power_lock(card) do { ; } while (0)
-#define snd_power_unlock(card) do { ; } while (0)
-#define snd_power_wait(card) do { ; } while (0)
-#define snd_power_get_state(card) SNDRV_CTL_POWER_D0
-#define snd_power_change_state(card, state) do { ; } while (0)
+#define snd_power_lock(card) do { (void)(card); } while (0)
+#define snd_power_unlock(card) do { (void)(card); } while (0)
+#define snd_power_wait(card) do { (void)(card); } while (0)
+#define snd_power_get_state(card) SNDRV_CTL_POWER_D0
+#define snd_power_change_state(card, state) do { (void)(card); } while (0)
#endif
/* device.c */
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [patch] ALSA compiler warnings fixes
2002-11-18 20:53 Robert Love
@ 2002-11-18 21:01 ` Jeff Garzik
2002-11-18 21:47 ` Robert Love
0 siblings, 1 reply; 4+ messages in thread
From: Jeff Garzik @ 2002-11-18 21:01 UTC (permalink / raw)
To: Robert Love; +Cc: torvalds, linux-kernel
Robert Love wrote:
> Linus,
>
> Attached patch fixes numerous warnings in ALSA core of the type "unused
> variable foo" due to defined-away functions.
ALSA has an active maintainer, you should at least CC them on patches to
their subsystem...
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [patch] ALSA compiler warnings fixes
2002-11-18 21:01 ` Jeff Garzik
@ 2002-11-18 21:47 ` Robert Love
0 siblings, 0 replies; 4+ messages in thread
From: Robert Love @ 2002-11-18 21:47 UTC (permalink / raw)
To: Jeff Garzik, perex; +Cc: torvalds, linux-kernel
On Mon, 2002-11-18 at 16:01, Jeff Garzik wrote:
> ALSA has an active maintainer, you should at least CC them on
> patches to their subsystem...
It is hard to tell, they are off on their own list with their own CVS...
Here it is again. Is this OK with you guys? It fixes a bunch of
warnings in my compile.
Robert Love
Fix numerous ALSA core compiler warnings of the type "unused variable foo"
include/sound/core.h | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)
diff -urN linux-2.5.48/include/sound/core.h linux/include/sound/core.h
--- linux-2.5.48/include/sound/core.h 2002-11-17 23:29:57.000000000 -0500
+++ linux/include/sound/core.h 2002-11-18 15:51:59.000000000 -0500
@@ -177,11 +177,11 @@
wake_up(&card->power_sleep);
}
#else
-#define snd_power_lock(card) do { ; } while (0)
-#define snd_power_unlock(card) do { ; } while (0)
-#define snd_power_wait(card) do { ; } while (0)
-#define snd_power_get_state(card) SNDRV_CTL_POWER_D0
-#define snd_power_change_state(card, state) do { ; } while (0)
+#define snd_power_lock(card) do { (void)(card); } while (0)
+#define snd_power_unlock(card) do { (void)(card); } while (0)
+#define snd_power_wait(card) do { (void)(card); } while (0)
+#define snd_power_get_state(card) SNDRV_CTL_POWER_D0
+#define snd_power_change_state(card, state) do { (void)(card); } while (0)
#endif
/* device.c */
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [patch] ALSA compiler warnings fixes
[not found] <fa.h0vvikv.k5838k@ifi.uio.no>
@ 2002-11-19 11:30 ` Giacomo Catenazzi
0 siblings, 0 replies; 4+ messages in thread
From: Giacomo Catenazzi @ 2002-11-19 11:30 UTC (permalink / raw)
To: Robert Love; +Cc: linux-kernel
> +#define snd_power_unlock(card) do { (void)(card); } while (0)
Why do we use in kernel:
do { (void)(foobar); } while (0)
instead of the simpler and normally used in std files (e.g. assert.h):
((void)(foobar),0)
?
The "do while(0)" is used for multi-statment macros, not the case for
void statment!
ciao
giacomo
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2002-11-19 11:23 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <fa.h0vvikv.k5838k@ifi.uio.no>
2002-11-19 11:30 ` [patch] ALSA compiler warnings fixes Giacomo Catenazzi
2002-11-18 20:53 Robert Love
2002-11-18 21:01 ` Jeff Garzik
2002-11-18 21:47 ` Robert Love
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox