summaryrefslogtreecommitdiff
path: root/lib/sqfs/comp/lzma.c
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2020-06-04 07:24:52 +0200
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2020-06-04 07:24:52 +0200
commitb6d0bcbf1fa9c8088578c959f442e219f590ebf9 (patch)
tree2aaffddd7c46e1850b651796797c8df18622b14e /lib/sqfs/comp/lzma.c
parent30597cc7c5d566f671c84c025de97cb1fc2d242e (diff)
Cleanup: Pull compression level parameter out into compressor config
Every compressor (except LC4) has a compression level parameter. This commit pulls the compression level field out into the generic configuration structure and applies some code clean ups as a result from this. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'lib/sqfs/comp/lzma.c')
-rw-r--r--lib/sqfs/comp/lzma.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/sqfs/comp/lzma.c b/lib/sqfs/comp/lzma.c
index b674af9..01e6042 100644
--- a/lib/sqfs/comp/lzma.c
+++ b/lib/sqfs/comp/lzma.c
@@ -185,8 +185,8 @@ static void lzma_get_configuration(const sqfs_compressor_t *base,
cfg->id = SQFS_COMP_LZMA;
cfg->block_size = lzma->block_size;
cfg->flags = lzma->flags;
+ cfg->level = lzma->level;
cfg->opt.lzma.dict_size = lzma->dict_size;
- cfg->opt.lzma.level = lzma->level;
cfg->opt.lzma.lc = lzma->lc;
cfg->opt.lzma.lp = lzma->lp;
cfg->opt.lzma.pb = lzma->pb;
@@ -220,7 +220,7 @@ int lzma_compressor_create(const sqfs_compressor_config_t *cfg,
return SQFS_ERROR_UNSUPPORTED;
/* XXX: values are unsigned and minimum is 0 */
- if (cfg->opt.lzma.level > SQFS_LZMA_MAX_LEVEL)
+ if (cfg->level > SQFS_LZMA_MAX_LEVEL)
return SQFS_ERROR_UNSUPPORTED;
if (cfg->opt.lzma.lc > SQFS_LZMA_MAX_LC)
@@ -262,8 +262,8 @@ int lzma_compressor_create(const sqfs_compressor_config_t *cfg,
lzma->block_size = cfg->block_size;
lzma->flags = cfg->flags;
+ lzma->level = cfg->level;
lzma->dict_size = cfg->opt.lzma.dict_size;
- lzma->level = cfg->opt.lzma.level;
lzma->lc = cfg->opt.lzma.lc;
lzma->lp = cfg->opt.lzma.lp;
lzma->pb = cfg->opt.lzma.pb;