Skip to content

Commit

Permalink
udf: fix udf_debug macro
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Marcin Slusarz authored and Linus Torvalds committed Feb 8, 2008
1 parent 48d6d8f commit 756fa92
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions include/linux/udf_fs.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@

#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
Expand Down

0 comments on commit 756fa92

Please sign in to comment.