mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Yury Norov <yury.norov@gmail.com>
To: Andrew Morton <akpm@linux-foundation.org>,
	Mikhail Zaslonko <zaslonko@linux.ibm.com>,
	Heiko Carstens <heiko.carstens@de.ibm.com>,
	Ilya Leoshkevich <iii@linux.ibm.com>,
	Sergey Senozhatsky <sergey.senozhatsky@gmail.com>,
	linux-kernel@vger.kernel.org
Cc: Yury Norov <yury.norov@gmail.com>, Joe Perches <joe@perches.com>
Subject: [PATCH] lib/zlib: drop EQUAL macro
Date: Wed,  5 Feb 2025 16:29:32 -0500	[thread overview]
Message-ID: <20250205212933.68695-1-yury.norov@gmail.com> (raw)

The macro is pre-historic, and only exists to help those readers who
don't know what memcmp() returns if memory areas differ. This is pretty
well documented, so the macro looks excessive.

Now that the only user of the macro depends on DEBUG_ZLIB config, GCC
warns about unused macro if the library is built with W=2 against
defconfig. So drop it for good.

Signed-off-by: Yury Norov <yury.norov@gmail.com>
---
scripts/get_maintainer.pl failed to attribute this patch, so adding
Andrew and recent active developers, and Joe Perches for the script.

$ scripts/get_maintainer.pl 0001-zlib-drop-EQUAL-macro.patch
Bad divisor in main::vcs_assign: 0
"GitAuthor: Yury Norov" <yury.norov@gmail.com> (authored:1/1=100%,added_lines:1/1=100%,removed_lines:5/5=100%)
linux-kernel@vger.kernel.org (open list)

 lib/zlib_deflate/deflate.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/lib/zlib_deflate/deflate.c b/lib/zlib_deflate/deflate.c
index 3a1d8d34182e..8fb2a3e17c0e 100644
--- a/lib/zlib_deflate/deflate.c
+++ b/lib/zlib_deflate/deflate.c
@@ -151,9 +151,6 @@ static const config configuration_table[10] = {
  * meaning.
  */
 
-#define EQUAL 0
-/* result of memcmp for equal strings */
-
 /* ===========================================================================
  * Update a hash value with the given input byte
  * IN  assertion: all calls to UPDATE_HASH are made with consecutive
@@ -713,8 +710,7 @@ static void check_match(
 )
 {
     /* check that the match is indeed a match */
-    if (memcmp((char *)s->window + match,
-                (char *)s->window + start, length) != EQUAL) {
+    if (memcmp((char *)s->window + match, (char *)s->window + start, length)) {
         fprintf(stderr, " start %u, match %u, length %d\n",
 		start, match, length);
         do {
-- 
2.43.0


             reply	other threads:[~2025-02-05 21:29 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-05 21:29 Yury Norov [this message]
2025-02-06 17:53 ` Zaslonko Mikhail

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=20250205212933.68695-1-yury.norov@gmail.com \
    --to=yury.norov@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=heiko.carstens@de.ibm.com \
    --cc=iii@linux.ibm.com \
    --cc=joe@perches.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sergey.senozhatsky@gmail.com \
    --cc=zaslonko@linux.ibm.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

all inboxes | Powered by JetHome®