Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=ee5c80239d5f152d99f69165afbd115518353563
Commit:     ee5c80239d5f152d99f69165afbd115518353563
Parent:     34521c5e4971d01f6ef650fdee59e07be6c2c5e3
Author:     Christoph Hellwig <[EMAIL PROTECTED]>
AuthorDate: Thu Aug 16 15:38:08 2007 +1000
Committer:  Tim Shimmin <[EMAIL PROTECTED]>
CommitDate: Wed Sep 5 14:49:30 2007 +1000

    [XFS] fix ASSERT and ASSERT_ALWAYS
    
    - remove the != 0 inside the unlikely in ASSERT_ALWAYS because sparse now
      complains about comparisons between pointers and 0
    - add a standalone ASSERT implementation because defining it to
      ASSERT_ALWAYS means the string is expanded before the token passing
      stringification. This way we get the actual content of the
      assertion in the assfail message and don't overflow sparse's
      stringification buffer leading to sparse error messages.
    
    SGI-PV: 968555
    SGI-Modid: xfs-linux-melb:xfs-kern:29310a
    
    Signed-off-by: Christoph Hellwig <[EMAIL PROTECTED]>
    Signed-off-by: David Chinner <[EMAIL PROTECTED]>
    Signed-off-by: Tim Shimmin <[EMAIL PROTECTED]>
---
 fs/xfs/support/debug.h |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/fs/xfs/support/debug.h b/fs/xfs/support/debug.h
index a27a7c8..855da04 100644
--- a/fs/xfs/support/debug.h
+++ b/fs/xfs/support/debug.h
@@ -34,10 +34,10 @@ extern void cmn_err(int, char *, ...)
 extern void assfail(char *expr, char *f, int l);
 
 #define ASSERT_ALWAYS(expr)    \
-       (unlikely((expr) != 0) ? (void)0 : assfail(#expr, __FILE__, __LINE__))
+       (unlikely(expr) ? (void)0 : assfail(#expr, __FILE__, __LINE__))
 
 #ifndef DEBUG
-# define ASSERT(expr)  ((void)0)
+#define ASSERT(expr)   ((void)0)
 
 #ifndef STATIC
 # define STATIC static noinline
@@ -49,8 +49,10 @@ extern void assfail(char *expr, char *f, int l);
 
 #else /* DEBUG */
 
-# define ASSERT(expr)  ASSERT_ALWAYS(expr)
-# include <linux/random.h>
+#include <linux/random.h>
+
+#define ASSERT(expr)   \
+       (unlikely(expr) ? (void)0 : assfail(#expr, __FILE__, __LINE__))
 
 #ifndef STATIC
 # define STATIC noinline
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to