[Intel-gfx] [PATCH 1/2] sysfs: constify sysfs create/remove files harder

Rafael J. Wysocki rafael at kernel.org
Fri Oct 5 07:41:46 UTC 2018


On Fri, Oct 5, 2018 at 9:36 AM Jani Nikula <jani.nikula at intel.com> wrote:
>
> On Fri, 05 Oct 2018, "Rafael J. Wysocki" <rafael at kernel.org> wrote:
> > On Thu, Oct 4, 2018 at 4:38 PM Jani Nikula <jani.nikula at intel.com> 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.
:-)


More information about the Intel-gfx mailing list