udf: fix udf_debug macro

udf_debug should be enclosed with do { } while (0)
to be safely used in code like below:
if (something)
	udf_debug();
else
	anything;
(Otherwise compiler will not compile it with:
"error: expected expression before 'else'")

Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com>
Cc: Jan Kara <jack@suse.cz>
Cc: Christoph Hellwig <hch@lst.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
Marcin Slusarz 2008-02-08 04:20:46 -08:00 committed by Linus Torvalds
parent 48d6d8ff7d
commit 756fa92f4d
1 changed files with 2 additions and 2 deletions

View File

@ -39,11 +39,11 @@
#ifdef UDFFS_DEBUG #ifdef UDFFS_DEBUG
#define udf_debug(f, a...) \ #define udf_debug(f, a...) \
{ \ do { \
printk (KERN_DEBUG "UDF-fs DEBUG %s:%d:%s: ", \ printk (KERN_DEBUG "UDF-fs DEBUG %s:%d:%s: ", \
__FILE__, __LINE__, __FUNCTION__); \ __FILE__, __LINE__, __FUNCTION__); \
printk (f, ##a); \ printk (f, ##a); \
} } while (0)
#else #else
#define udf_debug(f, a...) /**/ #define udf_debug(f, a...) /**/
#endif #endif