> Yes, this looks more tidy than open it. I'll go this helper in v3.
>
> >
> > static void check_zswap_enabled(void)
> > {
> > char value;
>
> read_text() requires string but not char.
I was just illustrating. This should be passed in as &value. That should work?
>
> >
> > if (access("/sys/module/zswap", F_OK))
> > ksft_exit_skip("zswap isn't configured\n");
> >
> > if (read_text("/sys/module/zswap/parameters/enabled", value,
> > sizeof(value)) <= 0)
> > ksft_exit_fail_msg("Failed to read
> > /sys/module/zswap/parameters/enabled\n");
> >
> > if (value == 'N')
> > ksft_exit_skip("zswap is disabled (hint: echo 1 >
> > /sys/module/zswap/parameters/enabled)\n");
> > }
> >
>
> --
> Regards,
> Li Wang
>