Skip to content

Commit

Permalink
xfs: make the ASSERT() condition likely
Browse files Browse the repository at this point in the history
The ASSERT() condition is the normal case, not the exception,
so testing the condition should be likely(), not unlikely().

Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
  • Loading branch information
amir73il authored and djwong committed Jan 17, 2017
1 parent 49def18 commit bf46ecc
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions fs/xfs/xfs_linux.h
Original file line number Diff line number Diff line change
Expand Up @@ -331,11 +331,11 @@ static inline __uint64_t howmany_64(__uint64_t x, __uint32_t y)
}

#define ASSERT_ALWAYS(expr) \
(unlikely(expr) ? (void)0 : assfail(#expr, __FILE__, __LINE__))
(likely(expr) ? (void)0 : assfail(#expr, __FILE__, __LINE__))

#ifdef DEBUG
#define ASSERT(expr) \
(unlikely(expr) ? (void)0 : assfail(#expr, __FILE__, __LINE__))
(likely(expr) ? (void)0 : assfail(#expr, __FILE__, __LINE__))

#ifndef STATIC
# define STATIC noinline
Expand All @@ -346,7 +346,7 @@ static inline __uint64_t howmany_64(__uint64_t x, __uint32_t y)
#ifdef XFS_WARN

#define ASSERT(expr) \
(unlikely(expr) ? (void)0 : asswarn(#expr, __FILE__, __LINE__))
(likely(expr) ? (void)0 : asswarn(#expr, __FILE__, __LINE__))

#ifndef STATIC
# define STATIC static noinline
Expand Down

0 comments on commit bf46ecc

Please sign in to comment.