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 14/21] lib/zlib: update deflate to zlib 1.2.1.2 release
Date: Thu, 03 Dec 2026 08:29:54 +0100	[thread overview]
Message-ID: <20261203-zlib-sync-v1-14-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.1.2 release.

Only one change was "needed", other than the version string update:
  - Drop the data_type field from the deflate state and set the data
    type guess directly in z_stream.data_type.

There was one 1.2.1.2 change that wasn't relevant to the kernel copy:
  - VMS vsnprintf/strerror handling.

The kernel is now in sync with zlib commit 7a6955760ba9 ("zlib 1.2.1.2").

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

diff --git a/include/linux/zlib.h b/include/linux/zlib.h
index 2419cbc1e08f..2dbc3aec1f81 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.1.1" */
+/* zlib deflate based on ZLIB_VERSION "1.2.1.2" */
 /* zlib inflate based on ZLIB_VERSION "1.2.3" */
 
 /*
diff --git a/lib/zlib_deflate/deflate.c b/lib/zlib_deflate/deflate.c
index cb221eab7aa6..d6d29f63b572 100644
--- a/lib/zlib_deflate/deflate.c
+++ b/lib/zlib_deflate/deflate.c
@@ -1,6 +1,6 @@
 /* +++ deflate.c */
 /* deflate.c -- compress data using the deflation algorithm
- * Copyright (C) 1995-2003 Jean-loup Gailly.
+ * Copyright (C) 1995-2004 Jean-loup Gailly.
  * For conditions of distribution and use, see copyright notice in zlib.h
  */
 
diff --git a/lib/zlib_deflate/deftree.c b/lib/zlib_deflate/deftree.c
index 2eaf8264cc33..dbe0eda9a824 100644
--- a/lib/zlib_deflate/deftree.c
+++ b/lib/zlib_deflate/deftree.c
@@ -814,7 +814,7 @@ ulg zlib_tr_flush_block(
     if (s->level > 0) {
 
          /* Check if the file is ascii or binary */
-        if (s->data_type == Z_UNKNOWN) set_data_type(s);
+        if (s->strm->data_type == Z_UNKNOWN) set_data_type(s);
 
         /* Construct the literal and distance trees */
         build_tree(s, (tree_desc *)(&(s->l_desc)));
@@ -1027,7 +1027,7 @@ static void set_data_type(
     while (n < 7)        bin_freq += s->dyn_ltree[n++].Freq;
     while (n < 128)    ascii_freq += s->dyn_ltree[n++].Freq;
     while (n < LITERALS) bin_freq += s->dyn_ltree[n++].Freq;
-    s->data_type = (Byte)(bin_freq > (ascii_freq >> 2) ? Z_BINARY : Z_ASCII);
+    s->strm->data_type = bin_freq > (ascii_freq >> 2) ? Z_BINARY : Z_ASCII;
 }
 
 /* ===========================================================================
diff --git a/lib/zlib_deflate/defutil.h b/lib/zlib_deflate/defutil.h
index dec377b7d25c..b639235c4fa6 100644
--- a/lib/zlib_deflate/defutil.h
+++ b/lib/zlib_deflate/defutil.h
@@ -85,7 +85,6 @@ typedef struct deflate_state {
     Byte *pending_out;   /* next pending byte to output to the stream */
     int   pending;       /* nb of bytes in the pending buffer */
     int   wrap;          /* bit 0 true for zlib, bit 1 true for gzip */
-    Byte  data_type;     /* UNKNOWN, BINARY or ASCII */
     Byte  method;        /* STORED (for zip only) or DEFLATED */
     int   last_flush;    /* value of flush param for previous deflate call */
 

-- 
2.56.1


  parent reply	other threads:[~2026-12-03  7:31 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 ` [PATCH 08/21] lib/zlib: update deflate to zlib 1.2.0.5 release Greg Kroah-Hartman
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 ` Greg Kroah-Hartman [this message]
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-14-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®