Skip to content

Commit 9010dbc

Browse files
mzaslonkakpm00
authored andcommitted
lib/zlib: DFLTCC support inflate with small window
There is no hardware control for DFLTCC window size. After this change, software and hardware window formats no longer match: the software will use wbits and wsize, and the hardware will use HB_BITS and HB_SIZE. Since neither dictionary manipulation nor internal allocation functions are relevant to kernel zlib and zlib_inflate_workspacesize() always use MAX_WBITS for window size calculation, only dfltcc_can_inflate() and dfltcc_inflate() functions are affected by this patch. This commit is based on: zlib-ng/zlib-ng@3eab317 Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Mikhail Zaslonko <[email protected]> Acked-by: Ilya Leoshkevich <[email protected]> Cc: Heiko Carstens <[email protected]> Cc: Vasily Gorbik <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
1 parent 9fec9f8 commit 9010dbc

File tree

1 file changed

+0
-8
lines changed

1 file changed

+0
-8
lines changed

lib/zlib_dfltcc/dfltcc_inflate.c

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,6 @@ int dfltcc_can_inflate(
2222
zlib_dfltcc_support == ZLIB_DFLTCC_DEFLATE_ONLY)
2323
return 0;
2424

25-
/* Unsupported compression settings */
26-
if (state->wbits != HB_BITS)
27-
return 0;
28-
2925
/* Unsupported hardware */
3026
return is_bit_set(dfltcc_state->af.fns, DFLTCC_XPND) &&
3127
is_bit_set(dfltcc_state->af.fmts, DFLTCC_FMT0);
@@ -129,8 +125,6 @@ dfltcc_inflate_action dfltcc_inflate(
129125
/* Translate stream to parameter block */
130126
param->cvt = CVT_ADLER32;
131127
param->sbb = state->bits;
132-
param->hl = state->whave; /* Software and hardware history formats match */
133-
param->ho = (state->write - state->whave) & ((1 << HB_BITS) - 1);
134128
if (param->hl)
135129
param->nt = 0; /* Honor history for the first block */
136130
param->cv = state->check;
@@ -144,8 +138,6 @@ dfltcc_inflate_action dfltcc_inflate(
144138
strm->msg = oesc_msg(dfltcc_state->msg, param->oesc);
145139
state->last = cc == DFLTCC_CC_OK;
146140
state->bits = param->sbb;
147-
state->whave = param->hl;
148-
state->write = (param->ho + param->hl) & ((1 << HB_BITS) - 1);
149141
state->check = param->cv;
150142
if (cc == DFLTCC_CC_OP2_CORRUPT && param->oesc != 0) {
151143
/* Report an error if stream is corrupted */

0 commit comments

Comments
 (0)