Skip to content

Commit

Permalink
Add missing parenthesis in VERIFYF()
Browse files Browse the repository at this point in the history
Without them the order of operations might get unexpected.

Reviewed-by: Adam Moss <c@yotes.com>
Reviewed-by: Jorgen Lundman <lundman@lundman.net>
Reviewed-by: Rob Norris <robn@despairlabs.com>
Signed-off-by: Alexander Motin <mav@FreeBSD.org>
Sponsored by:	iXsystems, Inc.
Closes openzfs#16826
  • Loading branch information
amotin authored and lundman committed Jan 22, 2025
1 parent 3f29f14 commit e7c25d2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion include/os/freebsd/spl/sys/debug.h
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ spl_assert(const char *buf, const char *file, const char *func, int line)
__FILE__, __FUNCTION__, __LINE__))

#define VERIFYF(cond, str, ...) do { \
if (unlikely(!cond)) \
if (unlikely(!(cond))) \
spl_panic(__FILE__, __FUNCTION__, __LINE__, \
"VERIFY(" #cond ") failed " str "\n", __VA_ARGS__);\
} while (0)
Expand Down
2 changes: 1 addition & 1 deletion include/os/linux/spl/sys/debug.h
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ spl_assert(const char *buf, const char *file, const char *func, int line)
__FILE__, __FUNCTION__, __LINE__))

#define VERIFYF(cond, str, ...) do { \
if (unlikely(!cond)) \
if (unlikely(!(cond))) \
spl_panic(__FILE__, __FUNCTION__, __LINE__, \
"VERIFY(" #cond ") failed " str "\n", __VA_ARGS__);\
} while (0)
Expand Down

0 comments on commit e7c25d2

Please sign in to comment.