lkml.org 
[lkml]   [2008]   [Jan]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Subject[PATCH 15/16] udf: fix udf_debug macro
DateThu, 10 Jan 2008 23:06:31 +0100
From marcin.slusarz@gmail ...
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>
---
include/linux/udf_fs.h | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/include/linux/udf_fs.h b/include/linux/udf_fs.h
index 36c684e..c954527 100644
--- a/include/linux/udf_fs.h
+++ b/include/linux/udf_fs.h
@@ -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
--
1.5.3.7


\
 
 \ /
  Last update: 2008-01-10 23:15    [from the cache]
©2003-2010