lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20250205212933.68695-1-yury.norov@gmail.com>
Date: Wed,  5 Feb 2025 16:29:32 -0500
From: Yury Norov <yury.norov@...il.com>
To: Andrew Morton <akpm@...ux-foundation.org>,
	Mikhail Zaslonko <zaslonko@...ux.ibm.com>,
	Heiko Carstens <heiko.carstens@...ibm.com>,
	Ilya Leoshkevich <iii@...ux.ibm.com>,
	Sergey Senozhatsky <sergey.senozhatsky@...il.com>,
	linux-kernel@...r.kernel.org
Cc: Yury Norov <yury.norov@...il.com>,
	Joe Perches <joe@...ches.com>
Subject: [PATCH] lib/zlib: drop EQUAL macro

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@...il.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@...il.com> (authored:1/1=100%,added_lines:1/1=100%,removed_lines:5/5=100%)
linux-kernel@...r.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


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ