lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <def39f2c-abc0-457b-9807-9a76e7da3161@app.fastmail.com>
Date: Tue, 25 Feb 2025 21:35:56 +0100
From: "Arnd Bergmann" <arnd@...db.de>
To: "Christophe JAILLET" <christophe.jaillet@...adoo.fr>,
 "Arnd Bergmann" <arnd@...nel.org>, "Mike Marshall" <hubcap@...ibond.com>
Cc: "Martin Brandenburg" <martin@...ibond.com>,
 "Alexander Viro" <viro@...iv.linux.org.uk>,
 "Greg Kroah-Hartman" <gregkh@...uxfoundation.org>, devel@...ts.orangefs.org,
 linux-kernel@...r.kernel.org
Subject: Re: [PATCH] orangefs: move s_kmod_keyword_mask_map[] into debugfs.c

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@...db.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;
 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ