From: Yury Norov Date: Wed, 5 Feb 2025 21:29:32 +0000 (-0500) Subject: lib/zlib: drop EQUAL macro X-Git-Tag: v6.15-rc1~80^2~61 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b115b6eccdf5a09909b1db6f1c37074923337f5c;p=thirdparty%2Flinux.git lib/zlib: drop EQUAL macro The macro is prehistoric, 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. Link: https://lkml.kernel.org/r/20250205212933.68695-1-yury.norov@gmail.com Signed-off-by: Yury Norov Reviewed-by: Sergey Senozhatsky Reviewed-by: Mikhail Zaslonko Cc: Heiko Carsten Cc: Ilya Leoshkevich Cc: Joe Perches Signed-off-by: Andrew Morton --- diff --git a/lib/zlib_deflate/deflate.c b/lib/zlib_deflate/deflate.c index 3a1d8d34182e4..8fb2a3e17c0e3 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 {