public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] zstd: use NULL instead of 0 for NULL pointer
@ 2024-09-09 21:38 Min-Hua Chen
  0 siblings, 0 replies; only message in thread
From: Min-Hua Chen @ 2024-09-09 21:38 UTC (permalink / raw)
  To: Nick Terrell; +Cc: Min-Hua Chen, Nick Terrell, linux-kernel

Use NULL instead of 0 for NULL pointer to fix the
following sparse warning:
lib/zstd/compress/zstd_fast.c:726:28: sparse: warning: Using plain integer as NULL pointer

No functional changes intended.

Fixes: 98988fc8e9ed ("zstd: import upstream v1.5.5")
Signed-off-by: Min-Hua Chen <minhuadotchen@gmail.com>
---
 lib/zstd/compress/zstd_fast.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/zstd/compress/zstd_fast.c b/lib/zstd/compress/zstd_fast.c
index 3399b39c5dbc..b0dbe0db3310 100644
--- a/lib/zstd/compress/zstd_fast.c
+++ b/lib/zstd/compress/zstd_fast.c
@@ -723,7 +723,7 @@ static size_t ZSTD_compressBlock_fast_extDict_generic(
     U32 offcode;
     const BYTE* match0;
     size_t mLength;
-    const BYTE* matchEnd = 0; /* initialize to avoid warning, assert != 0 later */
+    const BYTE* matchEnd = NULL; /* initialize to avoid warning, assert != NULL later */
 
     size_t step;
     const BYTE* nextStep;
@@ -895,7 +895,7 @@ static size_t ZSTD_compressBlock_fast_extDict_generic(
 _match: /* Requires: ip0, match0, offcode, matchEnd */
 
     /* Count the forward length. */
-    assert(matchEnd != 0);
+    assert(matchEnd != NULL);
     mLength += ZSTD_count_2segments(ip0 + mLength, match0 + mLength, iend, matchEnd, prefixStart);
 
     ZSTD_storeSeq(seqStore, (size_t)(ip0 - anchor), anchor, iend, offcode, mLength);
-- 
2.43.0


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2024-09-09 21:38 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-09 21:38 [PATCH] zstd: use NULL instead of 0 for NULL pointer Min-Hua Chen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox