diff options
author | Al Viro <viro@ftp.linux.org.uk> | 2007-07-27 09:23:44 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-07-28 22:42:22 -0400 |
commit | 2d954d06acbcf9a5f7668a1897850c9b7be6b8f3 (patch) | |
tree | fee2f79872d2d24f50e92a3af2f9119c588eb40f /include/linux/reiserfs_fs.h | |
parent | 986c76036adb0b12cbe1bf1ce1f75586585ee227 (diff) |
fix preprocessor idiocy in reiserfs
#x blocks expansion of macro argument, but it won't do you any
good if it's already been expanded... As it is, RFALSE(cond, ....)
ended up with stringified _expanded_ cond. Real fun when cond contains
something like le32_to_cpu() and you are on a big-endian box...
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux/reiserfs_fs.h')
-rw-r--r-- | include/linux/reiserfs_fs.h | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/include/linux/reiserfs_fs.h b/include/linux/reiserfs_fs.h index 965d5b3ea9eb..180a9d832dde 100644 --- a/include/linux/reiserfs_fs.h +++ b/include/linux/reiserfs_fs.h | |||
@@ -81,14 +81,16 @@ void reiserfs_warning(struct super_block *s, const char *fmt, ...); | |||
81 | /* assertions handling */ | 81 | /* assertions handling */ |
82 | 82 | ||
83 | /** always check a condition and panic if it's false. */ | 83 | /** always check a condition and panic if it's false. */ |
84 | #define RASSERT( cond, format, args... ) \ | 84 | #define __RASSERT( cond, scond, format, args... ) \ |
85 | if( !( cond ) ) \ | 85 | if( !( cond ) ) \ |
86 | reiserfs_panic( NULL, "reiserfs[%i]: assertion " #cond " failed at " \ | 86 | reiserfs_panic( NULL, "reiserfs[%i]: assertion " scond " failed at " \ |
87 | __FILE__ ":%i:%s: " format "\n", \ | 87 | __FILE__ ":%i:%s: " format "\n", \ |
88 | in_interrupt() ? -1 : current -> pid, __LINE__ , __FUNCTION__ , ##args ) | 88 | in_interrupt() ? -1 : current -> pid, __LINE__ , __FUNCTION__ , ##args ) |
89 | 89 | ||
90 | #define RASSERT(cond, format, args...) __RASSERT(cond, #cond, format, ##args) | ||
91 | |||
90 | #if defined( CONFIG_REISERFS_CHECK ) | 92 | #if defined( CONFIG_REISERFS_CHECK ) |
91 | #define RFALSE( cond, format, args... ) RASSERT( !( cond ), format, ##args ) | 93 | #define RFALSE(cond, format, args...) __RASSERT(!(cond), "!(" #cond ")", format, ##args) |
92 | #else | 94 | #else |
93 | #define RFALSE( cond, format, args... ) do {;} while( 0 ) | 95 | #define RFALSE( cond, format, args... ) do {;} while( 0 ) |
94 | #endif | 96 | #endif |