[Intel-gfx] [PATCH 1/2] drm/i915/pm: Unconstify power_domain_str

Ville Syrjälä ville.syrjala at linux.intel.com
Thu Nov 19 10:39:10 PST 2015


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 at 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


More information about the Intel-gfx mailing list