udf: fix udf_debug macro
authorMarcin Slusarz <marcin.slusarz@gmail.com>
Fri, 8 Feb 2008 12:20:46 +0000 (04:20 -0800)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Fri, 8 Feb 2008 17:22:35 +0000 (09:22 -0800)
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>
include/linux/udf_fs.h

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