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

Jani Nikula
2015-11-20T08:16:59Z

On Thu, 19 Nov 2015, Ville Syrjälä <ville.syrjala@linux.intel.com> wrote:
> 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.

Agreed, particularly for long ones like this. Please just drop the
static.

BR,
Jani.

--
Jani Nikula, Intel Open Source Technology Center