From: Prakash Punnoor <prakash@punnoor.de>
To: Daniel Hazelton <dhazelton@enter.net>
Cc: dwmw2@infradead.org, linux-kernel@vger.kernel.org,
Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [Trivial Patch] Remove JFFS2 dependency on internal Zlib header
Date: Sun, 03 Jun 2007 08:21:13 +0800 [thread overview]
Message-ID: <46620979.9020901@punnoor.de> (raw)
In-Reply-To: <200706021520.36478.dhazelton@enter.net>
Daniel Hazelton wrote:
>
> 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..9f1b935 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"
>
> @@ -154,7 +153,7 @@ static int jffs2_zlib_decompress(unsigned char *data_in,
>
> /* If it's deflate, and it's got no preset dictionary, then
> we can tell zlib to skip the adler32 check. */
> - if (srclen > 2 && !(data_in[1] & PRESET_DICT) &&
> + if (srclen > 2 && !(data_in[1] & 0x20) &&
> ((data_in[0] & 0x0f) == Z_DEFLATED) &&
> !(((data_in[0]<<8) + data_in[1]) % 31)) {
>
Why not
#define PRESET_DICT 0x20
instead of obfuscating the code with a magic number ? (Or name it
differently if it clashes with something else...)
Cheers,
Prakash
next prev parent reply other threads:[~2007-06-03 0:21 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 [this message]
2007-06-03 1:46 ` Daniel Hazelton
2007-06-03 1:50 ` [Trivial Patch] Remove JFFS2 dependency on internal Zlib header (take 2) Daniel Hazelton
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=46620979.9020901@punnoor.de \
--to=prakash@punnoor.de \
--cc=akpm@linux-foundation.org \
--cc=dhazelton@enter.net \
--cc=dwmw2@infradead.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