linux-mtd.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mkfs.ubifs: remove ZSTD_CLEVEL_DEFAULT for backwards compatibillity
@ 2019-07-09 10:37 David Oberhollenzer
  0 siblings, 0 replies; only message in thread
From: David Oberhollenzer @ 2019-07-09 10:37 UTC (permalink / raw)
  To: linux-mtd; +Cc: richard, David Oberhollenzer

Support for ZSTD compression has been added recently through the ZSTD
library.

This patch removes usage of ZSTD_CLEVEL_DEFAULT, which isn't exposed
in older versions of the ZSTD library, and replaces it with with the
constant parameter 0. According to the documentation this should then
use a reasonable default (which is defined internally).

Other possible approachs include defining ZSTD_CLEVEL_DEFAULT to 3
(the value it _currently_ has) if it isn't defined. This patch chooses
the approach of passing 0 since this seems to be encouraged by the
existing documentation.

Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
---
 ubifs-utils/mkfs.ubifs/compr.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/ubifs-utils/mkfs.ubifs/compr.c b/ubifs-utils/mkfs.ubifs/compr.c
index 6239835..9eade89 100644
--- a/ubifs-utils/mkfs.ubifs/compr.c
+++ b/ubifs-utils/mkfs.ubifs/compr.c
@@ -120,8 +120,7 @@ static int zstd_compress(void *in_buf, size_t in_len, void *out_buf,
 {
 	size_t ret;
 
-	ret = ZSTD_compressCCtx(zctx, out_buf, *out_len, in_buf, in_len,
-				ZSTD_CLEVEL_DEFAULT);
+	ret = ZSTD_compressCCtx(zctx, out_buf, *out_len, in_buf, in_len, 0);
 	if (ZSTD_isError(ret)) {
 		errcnt += 1;
 		return -1;
-- 
2.21.0


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2019-07-09 10:38 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-09 10:37 [PATCH] mkfs.ubifs: remove ZSTD_CLEVEL_DEFAULT for backwards compatibillity David Oberhollenzer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).