Patch "zstd: Fix definition of assert()" has been added to the 6.1-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    zstd: Fix definition of assert()

to the 6.1-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     zstd-fix-definition-of-assert.patch
and it can be found in the queue-6.1 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 20c83d02e1ab046e7927cb86043bf5667790a694
Author: Jonathan Neuschäfer <j.neuschaefer@xxxxxxx>
Date:   Sun Jan 29 14:14:36 2023 +0100

    zstd: Fix definition of assert()
    
    [ Upstream commit 6906598f1ce93761716d780b6e3f171e13f0f4ce ]
    
    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 <j.neuschaefer@xxxxxxx>
    Signed-off-by: Nick Terrell <terrelln@xxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/lib/zstd/common/zstd_deps.h b/lib/zstd/common/zstd_deps.h
index 7a5bf44839c9c..f06df065dec01 100644
--- a/lib/zstd/common/zstd_deps.h
+++ b/lib/zstd/common/zstd_deps.h
@@ -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 */



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux