Commit 2d954d06 authored by Al Viro's avatar Al Viro Committed by Linus Torvalds

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: default avatarAl Viro <viro@zeniv.linux.org.uk>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 986c7603
...@@ -81,14 +81,16 @@ void reiserfs_warning(struct super_block *s, const char *fmt, ...); ...@@ -81,14 +81,16 @@ void reiserfs_warning(struct super_block *s, const char *fmt, ...);
/* assertions handling */ /* assertions handling */
/** always check a condition and panic if it's false. */ /** always check a condition and panic if it's false. */
#define RASSERT( cond, format, args... ) \ #define __RASSERT( cond, scond, format, args... ) \
if( !( cond ) ) \ if( !( cond ) ) \
reiserfs_panic( NULL, "reiserfs[%i]: assertion " #cond " failed at " \ reiserfs_panic( NULL, "reiserfs[%i]: assertion " scond " failed at " \
__FILE__ ":%i:%s: " format "\n", \ __FILE__ ":%i:%s: " format "\n", \
in_interrupt() ? -1 : current -> pid, __LINE__ , __FUNCTION__ , ##args ) in_interrupt() ? -1 : current -> pid, __LINE__ , __FUNCTION__ , ##args )
#define RASSERT(cond, format, args...) __RASSERT(cond, #cond, format, ##args)
#if defined( CONFIG_REISERFS_CHECK ) #if defined( CONFIG_REISERFS_CHECK )
#define RFALSE( cond, format, args... ) RASSERT( !( cond ), format, ##args ) #define RFALSE(cond, format, args...) __RASSERT(!(cond), "!(" #cond ")", format, ##args)
#else #else
#define RFALSE( cond, format, args... ) do {;} while( 0 ) #define RFALSE( cond, format, args... ) do {;} while( 0 )
#endif #endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment