Re: [PATCH 1/2] drm/i915/pm: Unconstify power_domain_str

Ville Syrjälä
2015-11-19T18:39:13Z

On Thu, Nov 19, 2015 at 06:26:23PM +0000, Daniel Stone wrote:
> Hey,
>
> On 19 November 2015 at 18:24, Ville Syrjälä
> <ville.syrjala@linux.intel.com> wrote:
> > On Thu, Nov 19, 2015 at 05:59:10PM +0000, Daniel Stone wrote:
> >> +static inline const char *
> >> +intel_display_power_domain_str(enum intel_display_power_domain domain)
> >
> > It's still const. And I assume now we end up duplicating these strings
> > in every object file that calls this. Why don't you just remove the
> > "static" from the original?
>
> Right, 'unstatic' is what I meant. Dropping const wouldn't have been
> very clever.
>
> Surely gcc's DCE pass will trivially eliminate this?

Dunno. But I rather dislike having code in headers anyway.

> I put it so it
> could lie next to the enum definition itself, but if you'd prefer,
> I'll happily move the definition to intel_runtime_pm.c (or whatever
> shed colour is deemed appropriate) instead.
>
> Cheers,
> Daniel

--
Ville Syrjälä
Intel OTC