public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: linux-kernel@vger.kernel.org
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Jaroslav Kysela <perex@perex.cz>,
	Steven Rostedt <srostedt@redhat.com>
Subject: [PATCH 4/5] sound: update snd_assert macro
Date: Thu, 02 Oct 2008 11:05:33 -0400	[thread overview]
Message-ID: <20081002151104.821728138@goodmis.org> (raw)
In-Reply-To: 20081002150529.087488257@goodmis.org

[-- Attachment #1: sound-core-fix-snd-assert-macro.patch --]
[-- Type: text/plain, Size: 1145 bytes --]

One user of the snd_assert macro calls a goto and the compiler
complains that the label is not used when the snd_assert is
not set.

This patch makes snd_assert more robust when not defined to
let the compiler know about arguments when not in use.

CC: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Steven Rostedt <srostedt@redhat.com>
---
 include/sound/core.h |    8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

Index: linux-compile.git/include/sound/core.h
===================================================================
--- linux-compile.git.orig/include/sound/core.h	2008-07-27 09:26:33.000000000 -0400
+++ linux-compile.git/include/sound/core.h	2008-10-02 10:00:57.000000000 -0400
@@ -407,7 +407,13 @@ void snd_verbose_printd(const char *file
 #else /* !CONFIG_SND_DEBUG */
 
 #define snd_printd(fmt, args...)	/* nothing */
-#define snd_assert(expr, args...)	(void)(expr)
+/* Keep the compiler happy by showing the expr and args */
+#define snd_assert(expr, args...)	do {	\
+	if (0) {				\
+		(void)(expr);			\
+		args;				\
+	}					\
+} while(0)
 #define snd_BUG()			/* nothing */
 
 #endif /* CONFIG_SND_DEBUG */

-- 

  parent reply	other threads:[~2008-10-02 15:12 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-02 15:05 [PATCH 0/5] Clean up patches Steven Rostedt
2008-10-02 15:05 ` [PATCH 1/5] xen: clean up label Steven Rostedt
2008-10-02 15:05 ` [PATCH 2/5] xen: remove unused function warnings Steven Rostedt
2008-10-02 15:05 ` [PATCH 3/5] xen: nuke dead code in enlighten.c Steven Rostedt
2008-10-02 15:05 ` Steven Rostedt [this message]
2008-10-03  9:10   ` [PATCH 4/5] sound: update snd_assert macro Takashi Iwai
2008-10-03 14:24     ` Steven Rostedt
2008-10-02 15:05 ` [PATCH 5/5] xen: nuke the ballon files Steven Rostedt
2008-10-02 15:34   ` Jeremy Fitzhardinge
2008-10-02 17:59     ` Steven Rostedt

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=20081002151104.821728138@goodmis.org \
    --to=rostedt@goodmis.org \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=perex@perex.cz \
    --cc=srostedt@redhat.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox