linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Dan Streetman <ddstreet@ieee.org>
To: Arvind Yadav <arvind.yadav.cs@gmail.com>
Cc: Seth Jennings <sjenning@redhat.com>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	Linux-MM <linux-mm@kvack.org>
Subject: Re: [PATCH] mm/zswap: constify struct kernel_param_ops uses
Date: Mon, 28 Aug 2017 09:29:11 -0400	[thread overview]
Message-ID: <CALZtONCY64ck=FDriOR=m_RJnURto2rGP76mu-k5-g=c-My_yw@mail.gmail.com> (raw)
In-Reply-To: <2e26a2cef6e2148a7aadb77e9e64835fab6b4dc2.1503769223.git.arvind.yadav.cs@gmail.com>

On Sat, Aug 26, 2017 at 1:41 PM, Arvind Yadav <arvind.yadav.cs@gmail.com> wrote:
> kernel_param_ops are not supposed to change at runtime. All functions
> working with kernel_param_ops provided by <linux/moduleparam.h> work
> with const kernel_param_ops. So mark the non-const structs as const.
>
> Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>

Reviewed-by: Dan Streetman <ddstreet@ieee.org>

> ---
>  mm/zswap.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/mm/zswap.c b/mm/zswap.c
> index d39581a..030fbf9 100644
> --- a/mm/zswap.c
> +++ b/mm/zswap.c
> @@ -82,7 +82,7 @@ static u64 zswap_duplicate_entry;
>  static bool zswap_enabled;
>  static int zswap_enabled_param_set(const char *,
>                                    const struct kernel_param *);
> -static struct kernel_param_ops zswap_enabled_param_ops = {
> +static const struct kernel_param_ops zswap_enabled_param_ops = {
>         .set =          zswap_enabled_param_set,
>         .get =          param_get_bool,
>  };
> @@ -93,7 +93,7 @@ module_param_cb(enabled, &zswap_enabled_param_ops, &zswap_enabled, 0644);
>  static char *zswap_compressor = ZSWAP_COMPRESSOR_DEFAULT;
>  static int zswap_compressor_param_set(const char *,
>                                       const struct kernel_param *);
> -static struct kernel_param_ops zswap_compressor_param_ops = {
> +static const struct kernel_param_ops zswap_compressor_param_ops = {
>         .set =          zswap_compressor_param_set,
>         .get =          param_get_charp,
>         .free =         param_free_charp,
> @@ -105,7 +105,7 @@ module_param_cb(compressor, &zswap_compressor_param_ops,
>  #define ZSWAP_ZPOOL_DEFAULT "zbud"
>  static char *zswap_zpool_type = ZSWAP_ZPOOL_DEFAULT;
>  static int zswap_zpool_param_set(const char *, const struct kernel_param *);
> -static struct kernel_param_ops zswap_zpool_param_ops = {
> +static const struct kernel_param_ops zswap_zpool_param_ops = {
>         .set =          zswap_zpool_param_set,
>         .get =          param_get_charp,
>         .free =         param_free_charp,
> --
> 2.7.4
>

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

      reply	other threads:[~2017-08-28 13:29 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-26 17:41 Arvind Yadav
2017-08-28 13:29 ` Dan Streetman [this message]

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='CALZtONCY64ck=FDriOR=m_RJnURto2rGP76mu-k5-g=c-My_yw@mail.gmail.com' \
    --to=ddstreet@ieee.org \
    --cc=arvind.yadav.cs@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=sjenning@redhat.com \
    /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