Re: [PATCH 1/2] sysfs: constify sysfs create/remove files harder

From: Rafael J. Wysocki
Date: Fri Oct 05 2018 - 03:42:00 EST


On Fri, Oct 5, 2018 at 9:36 AM Jani Nikula <jani.nikula@xxxxxxxxx> wrote:
>
> On Fri, 05 Oct 2018, "Rafael J. Wysocki" <rafael@xxxxxxxxxx> wrote:
> > On Thu, Oct 4, 2018 at 4:38 PM Jani Nikula <jani.nikula@xxxxxxxxx> wrote:
> >>
> >> Let the passed in array be const (and thus placed in rodata) instead of
> >> a mutable array of const pointers.
> >
> > I'm not sure if the changes guarantee what you want. If I'm not
> > mistaken, they just mean that the function itself cannot modify either
> > the pointer passed to it, or the contents of the array pointed to by
> > that pointer. They don't imply the location of the array itself,
> > though.
>
> I mean, this change allows the caller to add the appropriate const
> qualifiers to the array definition, allowing the placement in
> rodata. Can't do that withouth the extra const in the function.

I figured that out, but the changelog is a bit unclear. If you said
"Allow ..." instead of "Let ...", it would be somewhat clearer IMO.
:-)