All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Hazelton <dhazelton@enter.net>
To: Prakash Punnoor <prakash@punnoor.de>
Cc: dwmw2@infradead.org, Andrew Morton <akpm@linux-foundation.org>,
	linux-kernel@vger.kernel.org
Subject: [Trivial Patch] Remove JFFS2 dependency on internal Zlib header (take 2)
Date: Sat, 2 Jun 2007 21:50:27 -0400	[thread overview]
Message-ID: <200706022150.27746.dhazelton@enter.net> (raw)
In-Reply-To: <46620979.9020901@punnoor.de>

[-- Attachment #1: Type: text/plain, Size: 1037 bytes --]

No code besides zlib itself should depend on linux/zutil.h - the only item 
JFFS2 uses from that header is a constant that is defined in RFC 1950 and 
should never change. This patch mirrors the #define in zutil.h and removes 
the #include.

Signed-off-by: Daniel Hazelton <dhazelton@enter.net>

DRH

diff --git a/fs/jffs2/compr_zlib.c b/fs/jffs2/compr_zlib.c
index 2b87fcc..f4519db 100644
--- a/fs/jffs2/compr_zlib.c
+++ b/fs/jffs2/compr_zlib.c
@@ -16,7 +16,6 @@
 #include <linux/kernel.h>
 #include <linux/slab.h>
 #include <linux/zlib.h>
-#include <linux/zutil.h>
 #include "nodelist.h"
 #include "compr.h"

@@ -29,6 +28,13 @@
        */
 #define STREAM_END_SPACE 12

+/*
+ * PRESET_DICT is set in the internal (aka: private) zlib header zutil.h
+ * the value - 0x20 - is defined in RFC 1950, so making a duplicate
+ * definition here to remove this code's dependency on that file is safe.
+ */
+#define PRESET_DICT 0x20
+
 static DEFINE_MUTEX(deflate_mutex);
 static DEFINE_MUTEX(inflate_mutex);
 static z_stream inf_strm, def_strm;

[-- Attachment #2: remove-jffs2-zutil.h-dependency.patch --]
[-- Type: text/x-diff, Size: 732 bytes --]

diff --git a/fs/jffs2/compr_zlib.c b/fs/jffs2/compr_zlib.c
index 2b87fcc..f4519db 100644
--- a/fs/jffs2/compr_zlib.c
+++ b/fs/jffs2/compr_zlib.c
@@ -16,7 +16,6 @@
 #include <linux/kernel.h>
 #include <linux/slab.h>
 #include <linux/zlib.h>
-#include <linux/zutil.h>
 #include "nodelist.h"
 #include "compr.h"
 
@@ -29,6 +28,13 @@
 	*/
 #define STREAM_END_SPACE 12
 
+/*
+ * PRESET_DICT is set in the internal (aka: private) zlib header zutil.h
+ * the value - 0x20 - is defined in RFC 1950, so making a duplicate
+ * definition here to remove this code's dependency on that file is safe.
+ */
+#define PRESET_DICT 0x20
+
 static DEFINE_MUTEX(deflate_mutex);
 static DEFINE_MUTEX(inflate_mutex);
 static z_stream inf_strm, def_strm;

      parent reply	other threads:[~2007-06-03  1:50 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-02 19:20 [Trivial Patch] Remove JFFS2 dependency on internal Zlib header Daniel Hazelton
2007-06-03  0:21 ` Prakash Punnoor
2007-06-03  1:46   ` Daniel Hazelton
2007-06-03  1:50   ` Daniel Hazelton [this message]

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=200706022150.27746.dhazelton@enter.net \
    --to=dhazelton@enter.net \
    --cc=akpm@linux-foundation.org \
    --cc=dwmw2@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=prakash@punnoor.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.