From: Damien Le Moal <Damien.LeMoal@wdc.com>
To: "Markus.Elfring@web.de" <Markus.Elfring@web.de>,
"linux-fsdevel@vger.kernel.org" <linux-fsdevel@vger.kernel.org>,
"linux-xfs@vger.kernel.org" <linux-xfs@vger.kernel.org>
Cc: "darrick.wong@oracle.com" <darrick.wong@oracle.com>,
"torvalds@linux-foundation.org" <torvalds@linux-foundation.org>,
"jth@kernel.org" <jth@kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"hare@suse.de" <hare@suse.de>,
Naohiro Aota <Naohiro.Aota@wdc.com>
Subject: Re: [PATCH v10 1/2] fs: New zonefs file system
Date: Wed, 5 Feb 2020 01:35:58 +0000 [thread overview]
Message-ID: <cfb36fa5dcf97113198848874c0ca9ba215e26fa.camel@wdc.com> (raw)
In-Reply-To: <68ef8614-87f8-1b6e-7f55-f9d53a0f1e1c@web.de>
On Tue, 2020-02-04 at 10:46 +0100, Markus Elfring wrote:
> …
> > +++ b/fs/zonefs/super.c
> …
> > +static const char *zgroups_name[ZONEFS_ZTYPE_MAX] = { "cnv", "seq" };
>
> Can this array be treated as immutable?
> How do you think about to use the following code variant?
>
> +static const char const *zgroups_name[ZONEFS_ZTYPE_MAX] = { "cnv", "seq" };
That does not compile: duplicated const.
In any case, I am not sure what this would achieve since string
literals are constants by default and the pointer to the array is
declared as a constant too. This ends up completely with read-only text
section.
Declaring it as
static const char * const zgroups_name[] = { "cnv", "seq" };
is probably what you are suggesting, but since the string literals are
already constants by default, I do not think there is any difference.
>
> Regards,
> Markus
--
Damien Le Moal
Western Digital Research
next prev parent reply other threads:[~2020-02-05 1:36 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-04 9:46 [PATCH v10 1/2] fs: New zonefs file system Markus Elfring
2020-02-05 1:35 ` Damien Le Moal [this message]
2020-02-05 7:16 ` [v10 " Markus Elfring
2020-02-05 7:46 ` Damien Le Moal
2020-02-05 10:44 ` Markus Elfring
-- strict thread matches above, loose matches on Subject: below --
2020-01-29 13:11 [PATCH v10 0/2] " Damien Le Moal
2020-01-29 13:11 ` [PATCH v10 1/2] fs: " Damien Le Moal
2020-02-03 15:08 ` Johannes Thumshirn
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=cfb36fa5dcf97113198848874c0ca9ba215e26fa.camel@wdc.com \
--to=damien.lemoal@wdc.com \
--cc=Markus.Elfring@web.de \
--cc=Naohiro.Aota@wdc.com \
--cc=darrick.wong@oracle.com \
--cc=hare@suse.de \
--cc=jth@kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-xfs@vger.kernel.org \
--cc=torvalds@linux-foundation.org \
/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;
as well as URLs for NNTP newsgroup(s).