Re: [PATCH -next v7 2/4] mm/zswap: skip invalid or unchanged parameter

Sergey Senozhatsky
2023-03-26T03:08:27Z

On (23/03/25 15:14), Liu Shixin wrote:
> +++ b/mm/zswap.c
> @@ -761,15 +761,15 @@ static int __zswap_param_set(const char *val, const struct kernel_param *kp,
> char *s = strstrip((char *)val);
> int ret;
>
> + /* no change required */
> + if (!strcmp(s, *(char **)kp->arg) && zswap_has_pool)
> + return 0;
> +
> if (zswap_init_failed) {
> pr_err("can't set param, initialization failed\n");
> return -ENODEV;
> }
>
> - /* no change required */
> - if (!strcmp(s, *(char **)kp->arg) && zswap_has_pool)
> - return 0;

I probably would suggest to simply remove `*(char **)kp->arg`
from zswap code entirely, it doesn't solve any real problem
(as far as I can tell).