Skip to content

Commit 6906598

Browse files
neuschaeferterrelln
authored andcommitted
zstd: Fix definition of assert()
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]>
1 parent 038505c commit 6906598

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/zstd/common/zstd_deps.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ static uint64_t ZSTD_div64(uint64_t dividend, uint32_t divisor) {
8484

8585
#include <linux/kernel.h>
8686

87-
#define assert(x) WARN_ON((x))
87+
#define assert(x) WARN_ON(!(x))
8888

8989
#endif /* ZSTD_DEPS_ASSERT */
9090
#endif /* ZSTD_DEPS_NEED_ASSERT */

0 commit comments

Comments
 (0)