Mailing List Archive

[xen staging] xen/gzip: Drop huffman code table tracking
commit 8763eb782b2c349efb44900ebe82369bf89e0568
Author: Daniel P. Smith <dpsmith@apertussolutions.com>
AuthorDate: Wed Apr 17 10:37:16 2024 -0400
Commit: Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Thu Apr 18 20:43:11 2024 +0100

xen/gzip: Drop huffman code table tracking

The memory usage tracking isn't used outside of a debugging option which can't
compile under Xen anyway. Drop it.

Signed-off-by: Daniel P. Smith <dpsmith@apertussolutions.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
xen/common/gzip/inflate.c | 13 -------------
1 file changed, 13 deletions(-)

diff --git a/xen/common/gzip/inflate.c b/xen/common/gzip/inflate.c
index f2f953e80e..a03903f731 100644
--- a/xen/common/gzip/inflate.c
+++ b/xen/common/gzip/inflate.c
@@ -266,10 +266,6 @@ static const int dbits = 6; /* bits in base distance lookup table */
#define BMAX 16 /* maximum bit length of any code (16 for explode) */
#define N_MAX 288 /* maximum number of codes in any set */

-
-static unsigned __initdata hufts; /* track memory usage */
-
-
static int __init huft_build(
unsigned *b, /* code lengths in bits (all assumed <= BMAX) */
unsigned n, /* number of codes (assumed <= N_MAX) */
@@ -445,7 +441,6 @@ static int __init huft_build(
goto out;
}
DEBG1("4 ");
- hufts += z + 1; /* track memory usage */
*t = q + 1; /* link to list for huft_free() */
*(t = &(q->v.t)) = (struct huft *)NULL;
u[h] = ++q; /* table starts after link */
@@ -1023,7 +1018,6 @@ static int __init inflate(void)
{
int e; /* last block flag */
int r; /* result code */
- unsigned h; /* maximum struct huft's malloc'ed */

/* initialize window, bit buffer */
wp = 0;
@@ -1032,14 +1026,10 @@ static int __init inflate(void)


/* decompress until the last block */
- h = 0;
do {
- hufts = 0;
r = inflate_block(&e);
if (r)
return r;
- if (hufts > h)
- h = hufts;
} while (!e);

/* Undo too much lookahead. The next read will be byte aligned so we
@@ -1055,9 +1045,6 @@ static int __init inflate(void)


/* return success */
-#ifdef DEBUG
- fprintf(stderr, "<%u> ", h);
-#endif /* DEBUG */
return 0;
}

--
generated by git-patchbot for /home/xen/git/xen.git#staging