public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Min-Hua Chen <minhuadotchen@gmail.com>
To: Nick Terrell <terrelln@fb.com>
Cc: Min-Hua Chen <minhuadotchen@gmail.com>,
	Nick Terrell <terrelln@meta.com>,
	linux-kernel@vger.kernel.org
Subject: [PATCH] zstd: use NULL instead of 0 for NULL pointer
Date: Tue, 10 Sep 2024 05:38:08 +0800	[thread overview]
Message-ID: <20240909213811.192532-1-minhuadotchen@gmail.com> (raw)

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


                 reply	other threads:[~2024-09-09 21:38 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240909213811.192532-1-minhuadotchen@gmail.com \
    --to=minhuadotchen@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=terrelln@fb.com \
    --cc=terrelln@meta.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox