mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: davej@codemonkey.org.uk
To: torvalds@transmeta.com
Cc: linux-kernel@vger.kernel.org
Subject: guard mad16 debug macro.
Date: Mon, 24 Mar 2003 20:45:19 +0000	[thread overview]
Message-ID: <200303242045.h2OKjX35023101@deviant.impure.org.uk> (raw)

Still pretty ugly debug macro, but this at least
makes it do the right thing when used in if/else blocks

Fix from Joe Perches <joe@perches.com>

--- sound/oss/mad16.c.old	2003-03-24 09:31:49.000000000 -0800
+++ sound/oss/mad16.c	2003-03-24 09:39:14.000000000 -0800
@@ -99,7 +99,7 @@
 #ifdef DDB
 #undef DDB
 #endif
-#define DDB(x) {if (debug) x;}
+#define DDB(x) do {if (debug) x;} while (0)
 
 static unsigned char mad_read(int port)
 {
@@ -278,7 +278,8 @@
 	}
 	for (i = 0xf8d; i <= 0xf98; i++)
 		if (!c924pnp)
-			DDB(printk("Port %0x (init value) = %0x\n", i, mad_read(i))) else
+			DDB(printk("Port %0x (init value) = %0x\n", i, mad_read(i)));
+		else
 			DDB(printk("Port %0x (init value) = %0x\n", i-0x80, mad_read(i)));
 
 	if (board_type == C930)
--- sound/oss/sound_config.h.old	2003-02-17 14:55:56.000000000 -0800
+++ sound/oss/sound_config.h	2003-03-24 09:36:09.000000000 -0800
@@ -137,7 +137,7 @@
 #endif
 
 #ifndef DDB
-#define DDB(x) {}
+#define DDB(x) do {} while (0)
 #endif
 
 #ifndef MDB



                 reply	other threads:[~2003-03-24 20:34 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=200303242045.h2OKjX35023101@deviant.impure.org.uk \
    --to=davej@codemonkey.org.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@transmeta.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

all inboxes | Powered by JetHome®