Skip to content

Commit

Permalink
zstd: Fix definition of assert()
Browse files Browse the repository at this point in the history
assert(x) should emit a warning if x is false. WARN_ON(x) emits a
warning if x is true. Thus, assert(x) should be defined as WARN_ON(!x)
rather than WARN_ON(x).

Signed-off-by: Jonathan Neuschäfer <[email protected]>
Signed-off-by: Nick Terrell <[email protected]>
  • Loading branch information
neuschaefer authored and terrelln committed Mar 6, 2023
1 parent 038505c commit 6906598
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/zstd/common/zstd_deps.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ static uint64_t ZSTD_div64(uint64_t dividend, uint32_t divisor) {

#include <linux/kernel.h>

#define assert(x) WARN_ON((x))
#define assert(x) WARN_ON(!(x))

#endif /* ZSTD_DEPS_ASSERT */
#endif /* ZSTD_DEPS_NEED_ASSERT */
Expand Down

0 comments on commit 6906598

Please sign in to comment.