[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <cfb36fa5dcf97113198848874c0ca9ba215e26fa.camel@wdc.com>
Date: Wed, 5 Feb 2020 01:35:58 +0000
From: Damien Le Moal <Damien.LeMoal@....com>
To: "Markus.Elfring@....de" <Markus.Elfring@....de>,
"linux-fsdevel@...r.kernel.org" <linux-fsdevel@...r.kernel.org>,
"linux-xfs@...r.kernel.org" <linux-xfs@...r.kernel.org>
CC: "darrick.wong@...cle.com" <darrick.wong@...cle.com>,
"torvalds@...ux-foundation.org" <torvalds@...ux-foundation.org>,
"jth@...nel.org" <jth@...nel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"hare@...e.de" <hare@...e.de>, Naohiro Aota <Naohiro.Aota@....com>
Subject: Re: [PATCH v10 1/2] fs: New zonefs file system
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
Powered by blists - more mailing lists