mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Arnd Bergmann" <arnd@arndb.de>
To: "Christophe JAILLET" <christophe.jaillet@wanadoo.fr>,
	"Arnd Bergmann" <arnd@kernel.org>,
	"Mike Marshall" <hubcap@omnibond.com>
Cc: "Martin Brandenburg" <martin@omnibond.com>,
	"Alexander Viro" <viro@zeniv.linux.org.uk>,
	"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	devel@lists.orangefs.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] orangefs: move s_kmod_keyword_mask_map[] into debugfs.c
Date: Tue, 25 Feb 2025 21:35:56 +0100	[thread overview]
Message-ID: <def39f2c-abc0-457b-9807-9a76e7da3161@app.fastmail.com> (raw)
In-Reply-To: <dd1a326a-e165-4796-9005-6bff2019deef@wanadoo.fr>

On Tue, Feb 25, 2025, at 21:24, Christophe JAILLET wrote:
> Le 25/02/2025 à 21:08, Arnd Bergmann a écrit :
>> From: Arnd Bergmann <arnd@arndb.de>

>> + *      .           .           .
>> + */
>> +static struct __keyword_mask_s s_kmod_keyword_mask_map[] = {
>
> Unrelated to your patch, but I think that this could be made const.
>

Right, but not trivially, probably something like the change below.

There are obviously countless variables that should be const.

     Arnd

--- a/fs/orangefs/orangefs-debugfs.c
+++ b/fs/orangefs/orangefs-debugfs.c
@@ -73,7 +73,7 @@ struct __keyword_mask_s {
  *     qux          8           3
  *      .           .           .
  */
-static struct __keyword_mask_s s_kmod_keyword_mask_map[] = {
+static const struct __keyword_mask_s s_kmod_keyword_mask_map[] = {
        {"super", GOSSIP_SUPER_DEBUG},
        {"inode", GOSSIP_INODE_DEBUG},
        {"file", GOSSIP_FILE_DEBUG},
@@ -131,7 +131,7 @@ static int orangefs_prepare_cdm_array(char *);
 static void debug_mask_to_string(void *, int);
 static void do_k_string(void *, int);
 static void do_c_string(void *, int);
-static int keyword_is_amalgam(char *);
+static int keyword_is_amalgam(const char *);
 static int check_amalgam_keyword(void *, int);
 static void debug_string_to_mask(char *, void *, int);
 static void do_c_mask(int, char *, struct client_debug_mask **);
@@ -764,7 +764,7 @@ static void do_k_string(void *k_mask, int index)
 {
        __u64 *mask = (__u64 *) k_mask;
 
-       if (keyword_is_amalgam((char *) s_kmod_keyword_mask_map[index].keyword))
+       if (keyword_is_amalgam((const char *) s_kmod_keyword_mask_map[index].keyword))
                goto out;
 
        if (*mask & s_kmod_keyword_mask_map[index].mask_val) {
@@ -811,7 +811,7 @@ static void do_c_string(void *c_mask, int index)
        return;
 }
 
-static int keyword_is_amalgam(char *keyword)
+static int keyword_is_amalgam(const char *keyword)
 {
        int rc = 0;
 

      reply	other threads:[~2025-02-25 20:36 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-25 20:08 Arnd Bergmann
2025-02-25 20:24 ` Christophe JAILLET
2025-02-25 20:35   ` Arnd Bergmann [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=def39f2c-abc0-457b-9807-9a76e7da3161@app.fastmail.com \
    --to=arnd@arndb.de \
    --cc=arnd@kernel.org \
    --cc=christophe.jaillet@wanadoo.fr \
    --cc=devel@lists.orangefs.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=hubcap@omnibond.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=martin@omnibond.com \
    --cc=viro@zeniv.linux.org.uk \
    /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

all inboxes | Powered by JetHome®