From: Zaslonko Mikhail <zaslonko@linux.ibm.com>
To: Sergey Senozhatsky <senozhatsky@chromium.org>,
Andrew Morton <akpm@linux-foundation.org>
Cc: Minchan Kim <minchan@kernel.org>,
linux-kernel@vger.kernel.org, linux-mm@kvack.org
Subject: Re: [PATCH 1/2] zram: rename ZCOMP_PARAM_NO_LEVEL
Date: Wed, 14 May 2025 12:56:09 +0200 [thread overview]
Message-ID: <da57330c-46f3-4af6-aa49-a5cb26df37f7@linux.ibm.com> (raw)
In-Reply-To: <20250514024825.1745489-2-senozhatsky@chromium.org>
Reviewed-by: Mikhail Zaslonko <zaslonko@linux.ibm.com>
On 14.05.2025 04:47, Sergey Senozhatsky wrote:
> Use more generic name because this will be default "un-set"
> value for more params in the future.
>
> Signed-off-by: Sergey Senozhatsky <senozhatsky@chromium.org>
> ---
> drivers/block/zram/backend_deflate.c | 2 +-
> drivers/block/zram/backend_lz4.c | 2 +-
> drivers/block/zram/backend_lz4hc.c | 2 +-
> drivers/block/zram/backend_zstd.c | 2 +-
> drivers/block/zram/zcomp.h | 2 +-
> drivers/block/zram/zram_drv.c | 4 ++--
> 6 files changed, 7 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/block/zram/backend_deflate.c b/drivers/block/zram/backend_deflate.c
> index 0f7f252c12f4..4c00b5b6739f 100644
> --- a/drivers/block/zram/backend_deflate.c
> +++ b/drivers/block/zram/backend_deflate.c
> @@ -22,7 +22,7 @@ static void deflate_release_params(struct zcomp_params *params)
>
> static int deflate_setup_params(struct zcomp_params *params)
> {
> - if (params->level == ZCOMP_PARAM_NO_LEVEL)
> + if (params->level == ZCOMP_PARAM_NOT_SET)
> params->level = Z_DEFAULT_COMPRESSION;
>
> return 0;
> diff --git a/drivers/block/zram/backend_lz4.c b/drivers/block/zram/backend_lz4.c
> index 847f3334eb38..daccd60857eb 100644
> --- a/drivers/block/zram/backend_lz4.c
> +++ b/drivers/block/zram/backend_lz4.c
> @@ -18,7 +18,7 @@ static void lz4_release_params(struct zcomp_params *params)
>
> static int lz4_setup_params(struct zcomp_params *params)
> {
> - if (params->level == ZCOMP_PARAM_NO_LEVEL)
> + if (params->level == ZCOMP_PARAM_NOT_SET)
> params->level = LZ4_ACCELERATION_DEFAULT;
>
> return 0;
> diff --git a/drivers/block/zram/backend_lz4hc.c b/drivers/block/zram/backend_lz4hc.c
> index 5f37d5abcaeb..9e8a35dfa56d 100644
> --- a/drivers/block/zram/backend_lz4hc.c
> +++ b/drivers/block/zram/backend_lz4hc.c
> @@ -18,7 +18,7 @@ static void lz4hc_release_params(struct zcomp_params *params)
>
> static int lz4hc_setup_params(struct zcomp_params *params)
> {
> - if (params->level == ZCOMP_PARAM_NO_LEVEL)
> + if (params->level == ZCOMP_PARAM_NOT_SET)
> params->level = LZ4HC_DEFAULT_CLEVEL;
>
> return 0;
> diff --git a/drivers/block/zram/backend_zstd.c b/drivers/block/zram/backend_zstd.c
> index 22c8067536f3..81defb98ed09 100644
> --- a/drivers/block/zram/backend_zstd.c
> +++ b/drivers/block/zram/backend_zstd.c
> @@ -58,7 +58,7 @@ static int zstd_setup_params(struct zcomp_params *params)
> return -ENOMEM;
>
> params->drv_data = zp;
> - if (params->level == ZCOMP_PARAM_NO_LEVEL)
> + if (params->level == ZCOMP_PARAM_NOT_SET)
> params->level = zstd_default_clevel();
>
> zp->cprm = zstd_get_params(params->level, PAGE_SIZE);
> diff --git a/drivers/block/zram/zcomp.h b/drivers/block/zram/zcomp.h
> index 25339ed1e07e..cfacdfe9044c 100644
> --- a/drivers/block/zram/zcomp.h
> +++ b/drivers/block/zram/zcomp.h
> @@ -5,7 +5,7 @@
>
> #include <linux/mutex.h>
>
> -#define ZCOMP_PARAM_NO_LEVEL INT_MIN
> +#define ZCOMP_PARAM_NOT_SET INT_MIN
>
> /*
> * Immutable driver (backend) parameters. The driver may attach private
> diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c
> index 94e6e9b80bf0..a11b7a6e35f4 100644
> --- a/drivers/block/zram/zram_drv.c
> +++ b/drivers/block/zram/zram_drv.c
> @@ -1276,7 +1276,7 @@ static void comp_params_reset(struct zram *zram, u32 prio)
> struct zcomp_params *params = &zram->params[prio];
>
> vfree(params->dict);
> - params->level = ZCOMP_PARAM_NO_LEVEL;
> + params->level = ZCOMP_PARAM_NOT_SET;
> params->dict_sz = 0;
> params->dict = NULL;
> }
> @@ -1308,7 +1308,7 @@ static ssize_t algorithm_params_store(struct device *dev,
> const char *buf,
> size_t len)
> {
> - s32 prio = ZRAM_PRIMARY_COMP, level = ZCOMP_PARAM_NO_LEVEL;
> + s32 prio = ZRAM_PRIMARY_COMP, level = ZCOMP_PARAM_NOT_SET;
> char *args, *param, *val, *algo = NULL, *dict_path = NULL;
> struct zram *zram = dev_to_zram(dev);
> int ret;
next prev parent reply other threads:[~2025-05-14 10:56 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-14 2:47 [PATCH 0/2] zram: support algorithm-specific parameters Sergey Senozhatsky
2025-05-14 2:47 ` [PATCH 1/2] zram: rename ZCOMP_PARAM_NO_LEVEL Sergey Senozhatsky
2025-05-14 10:56 ` Zaslonko Mikhail [this message]
2025-05-14 2:47 ` [PATCH 2/2] zram: support deflate-specific params Sergey Senozhatsky
2025-05-14 10:58 ` Zaslonko Mikhail
2025-05-15 3:14 ` Sergey Senozhatsky
2025-05-15 3:17 ` Herbert Xu
2025-05-15 3:19 ` Sergey Senozhatsky
2025-05-15 3:24 ` Herbert Xu
2025-05-15 3:32 ` Sergey Senozhatsky
2025-05-15 3:38 ` Herbert Xu
2025-05-19 12:09 ` Zaslonko Mikhail
2025-05-23 12:22 ` Zaslonko Mikhail
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=da57330c-46f3-4af6-aa49-a5cb26df37f7@linux.ibm.com \
--to=zaslonko@linux.ibm.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=minchan@kernel.org \
--cc=senozhatsky@chromium.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).