lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date:	Tue, 29 Jul 2008 22:28:12 -0700
From:	David Brownell <david-b@...bell.net>
To:	linux-mtd@...ts.infradead.org, dwmw2@...radead.org,
	akpm@...ux-foundation.org
Cc:	michael.hennerich@...log.com, linux-kernel@...r.kernel.org,
	cooloney@...nel.org
Subject: [PATCH 2.6.26-git] MTD_DEBUG always does compile-time typechecks

From: David Brownell <dbrownell@...rs.sourceforge.net>

The current style for debug messages is to ensure they're always
parsed by the compiler and then subjected to dead code removal.
That way builds won't break only when debug options get enabled,
which is common when they are stripped out early by CPP.

This patch makes CONFIG_MTD_DEBUG adopt that convention.

Signed-off-by: David Brownell <dbrownell@...rs.sourceforge.net>
---
 include/linux/mtd/mtd.h |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

--- a/include/linux/mtd/mtd.h	2008-07-29 22:06:43.000000000 -0700
+++ b/include/linux/mtd/mtd.h	2008-07-29 22:19:21.000000000 -0700
@@ -272,7 +272,11 @@ static inline void mtd_erase_callback(st
 			printk(KERN_INFO args);		\
 	} while(0)
 #else /* CONFIG_MTD_DEBUG */
-#define DEBUG(n, args...) do { } while(0)
+#define DEBUG(n, args...)				\
+	do {						\
+		if (0)					\
+			printk(KERN_INFO args);		\
+	} while(0)
 
 #endif /* CONFIG_MTD_DEBUG */
 
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists