mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs.git
synced 2026-10-30 22:03:17 +01:00
Currently deflate and inflate both use a common state struct. There are several variables in this struct that we don't need for inflate, and more may be coming in the future. Therefore split them in two separate structs. Apart from that, introduce separate headers for dfltcc_deflate and dfltcc_inflate. This commit is based on: https://github.com/zlib-ng/zlib-ng/commit/c592b1b 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]>
41 lines
1.1 KiB
C
41 lines
1.1 KiB
C
// SPDX-License-Identifier: Zlib
|
|
/* dfltcc.c - SystemZ DEFLATE CONVERSION CALL support. */
|
|
|
|
#include <linux/export.h>
|
|
#include <linux/module.h>
|
|
#include "dfltcc_util.h"
|
|
#include "dfltcc.h"
|
|
|
|
char *oesc_msg(
|
|
char *buf,
|
|
int oesc
|
|
)
|
|
{
|
|
if (oesc == 0x00)
|
|
return NULL; /* Successful completion */
|
|
else {
|
|
#ifdef STATIC
|
|
return NULL; /* Ignore for pre-boot decompressor */
|
|
#else
|
|
sprintf(buf, "Operation-Ending-Supplemental Code is 0x%.2X", oesc);
|
|
return buf;
|
|
#endif
|
|
}
|
|
}
|
|
|
|
void dfltcc_reset_state(struct dfltcc_state *dfltcc_state) {
|
|
/* Initialize available functions */
|
|
if (is_dfltcc_enabled()) {
|
|
dfltcc(DFLTCC_QAF, &dfltcc_state->param, NULL, NULL, NULL, NULL, NULL);
|
|
memmove(&dfltcc_state->af, &dfltcc_state->param, sizeof(dfltcc_state->af));
|
|
} else
|
|
memset(&dfltcc_state->af, 0, sizeof(dfltcc_state->af));
|
|
|
|
/* Initialize parameter block */
|
|
memset(&dfltcc_state->param, 0, sizeof(dfltcc_state->param));
|
|
dfltcc_state->param.nt = 1;
|
|
dfltcc_state->param.ribm = DFLTCC_RIBM;
|
|
}
|
|
|
|
MODULE_LICENSE("GPL");
|