mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org,
	 Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Subject: [PATCH 08/21] lib/zlib: update deflate to zlib 1.2.0.5 release
Date: Thu, 03 Dec 2026 08:29:48 +0100	[thread overview]
Message-ID: <20261203-zlib-sync-v1-8-0d4ec56f1afb@linuxfoundation.org> (raw)
In-Reply-To: <20261203-zlib-sync-v1-0-0d4ec56f1afb@linuxfoundation.org>

Sync the kernel deflate code with the zlib 1.2.0.5 release.

This involves:
  - reorder the INSERT_STRING() assignment so match_head is assigned
    from the chained store rather than relying on the evaluation order
    of s->prev[...] = match_head = s->head[...]: when str aliases the
    head slot's chain this reads more clearly and avoids a sequencing
    surprise on exotic compilers, which the kernel really doesn't need
    to worry about at all, our compilers are anything but exotic,
    fortunatly.
  - change the TOO_FAR guard from "< 32768" to "<= 32767" to avoid an
    overflowing constant comparison on 16-bit ints.
  - comment case fix in zutil.h

There were some 1.2.0.5 changes that were not relevant to the kernel
copy:
  - alloc_func/free_func cast changes.
  - OS_CODE table reshuffle.

The kernel is now in sync with zlib commit 4b5a43a219d5 ("zlib 1.2.0.5").

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 include/linux/zlib.h       | 2 +-
 include/linux/zutil.h      | 2 +-
 lib/zlib_deflate/deflate.c | 4 ++--
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/include/linux/zlib.h b/include/linux/zlib.h
index fd34fd3ee715..5e6b5ed3766e 100644
--- a/include/linux/zlib.h
+++ b/include/linux/zlib.h
@@ -32,7 +32,7 @@
 
 #include <linux/zconf.h>
 
-/* zlib deflate based on ZLIB_VERSION "1.2.0.4" */
+/* zlib deflate based on ZLIB_VERSION "1.2.0.5" */
 /* zlib inflate based on ZLIB_VERSION "1.2.3" */
 
 /*
diff --git a/include/linux/zutil.h b/include/linux/zutil.h
index 2197ac6cff70..4032cfc1e82b 100644
--- a/include/linux/zutil.h
+++ b/include/linux/zutil.h
@@ -36,7 +36,7 @@ typedef unsigned long  ulg;
 
         /* target dependencies */
 
-        /* Common defaults */
+        /* common defaults */
 
 #ifndef OS_CODE
 #  define OS_CODE  0x03  /* assume Unix */
diff --git a/lib/zlib_deflate/deflate.c b/lib/zlib_deflate/deflate.c
index 7cc54a3551d7..cb221eab7aa6 100644
--- a/lib/zlib_deflate/deflate.c
+++ b/lib/zlib_deflate/deflate.c
@@ -171,7 +171,7 @@ static const config configuration_table[10] = {
  */
 #define INSERT_STRING(s, str, match_head) \
    (UPDATE_HASH(s, s->ins_h, s->window[(str) + (MIN_MATCH-1)]), \
-    s->prev[(str) & s->w_mask] = match_head = s->head[s->ins_h], \
+    match_head = s->prev[(str) & s->w_mask] = s->head[s->ins_h], \
     s->head[s->ins_h] = (Pos)(str))
 
 /* ===========================================================================
@@ -1173,7 +1173,7 @@ static block_state deflate_slow(
             /* longest_match() or longest_match_fast() sets match_start */
 
             if (s->match_length <= 5 && (s->strategy == Z_FILTERED
-#if TOO_FAR < 32768
+#if TOO_FAR <= 32767
                 || (s->match_length == MIN_MATCH &&
                     s->strstart - s->match_start > TOO_FAR)
 #endif

-- 
2.56.1


  parent reply	other threads:[~2026-12-03  7:30 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-03  7:29 [PATCH 00/21] lib/zlib: start to bring the in-kernel version in sync with upstream Greg Kroah-Hartman
2026-12-03  7:29 ` [PATCH 01/21] MAINTAINERS: add myself as the zlib maintainer Greg Kroah-Hartman
2026-12-03  7:29 ` [PATCH 02/21] lib/zlib: update deflate to zlib 1.1.4 release Greg Kroah-Hartman
2026-12-03  7:29 ` [PATCH 03/21] lib/zlib: update deflate to zlib 1.2.0 release Greg Kroah-Hartman
2026-12-03  7:29 ` [PATCH 04/21] lib/zlib: update deflate to zlib 1.2.0.1 release Greg Kroah-Hartman
2026-12-03  7:29 ` [PATCH 05/21] lib/zlib: update deflate to zlib 1.2.0.2 release Greg Kroah-Hartman
2026-12-03  7:29 ` [PATCH 06/21] lib/zlib: update deflate to zlib 1.2.0.3 release Greg Kroah-Hartman
2026-12-03  7:29 ` [PATCH 07/21] lib/zlib: update deflate to zlib 1.2.0.4 release Greg Kroah-Hartman
2026-12-03  7:29 ` Greg Kroah-Hartman [this message]
2026-12-03  7:29 ` [PATCH 09/21] lib/zlib: update deflate to zlib 1.2.0.6 release Greg Kroah-Hartman
2026-12-03  7:29 ` [PATCH 10/21] lib/zlib: update deflate to zlib 1.2.0.7 release Greg Kroah-Hartman
2026-12-03  7:29 ` [PATCH 11/21] lib/zlib: update deflate to zlib 1.2.0.8 release Greg Kroah-Hartman
2026-12-03  7:29 ` [PATCH 12/21] lib/zlib: update deflate to zlib 1.2.1 release Greg Kroah-Hartman
2026-12-03  7:29 ` [PATCH 13/21] lib/zlib: update deflate to zlib 1.2.1.1 release Greg Kroah-Hartman
2026-12-03  7:29 ` [PATCH 14/21] lib/zlib: update deflate to zlib 1.2.1.2 release Greg Kroah-Hartman
2026-12-03  7:29 ` [PATCH 15/21] lib/zlib: update deflate to zlib 1.2.2 release Greg Kroah-Hartman
2026-12-03  7:29 ` [PATCH 16/21] lib/zlib: update deflate to zlib 1.2.2.1 release Greg Kroah-Hartman
2026-12-03  7:29 ` [PATCH 17/21] lib/zlib: catch code up to the real zlib 1.1.3 Greg Kroah-Hartman
2026-12-03  7:29 ` [PATCH 18/21] lib/zlib: update deflate to zlib 1.2.2.2 release Greg Kroah-Hartman
2026-12-03  7:29 ` [PATCH 19/21] lib/zlib: update deflate to zlib 1.2.2.3 release Greg Kroah-Hartman
2026-12-03  7:30 ` [PATCH 20/21] lib/zlib: update deflate to zlib 1.2.2.4 release Greg Kroah-Hartman
2026-12-03  7:30 ` [PATCH 21/21] lib/zlib: update deflate to zlib 1.2.3 release Greg Kroah-Hartman

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=20261203-zlib-sync-v1-8-0d4ec56f1afb@linuxfoundation.org \
    --to=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    /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®