Re: [PATCH 2/3] drm/i915: add yesno utility function

Jani Nikula
2015-08-27T13:50:05Z

On Thu, 27 Aug 2015, Chris Wilson <chris@chris-wilson.co.uk> wrote:
> On Thu, Aug 27, 2015 at 04:23:30PM +0300, Jani Nikula wrote:
>> Add a common function to return "yes" or "no" string based on the
>> argument, and drop the local versions of it.
>
> Purely out of curiosity, gcc is able to amalgamate the constant strings
> (I remember reading that it is intelligent enough to do so), right? i.e.
> size i915.ko doesn't change (at least .data, we may see .text
> differences for gcc having different ideas about inlines)?

I admit to giving GCC the benefit of the doubt. I may be naïve that way,
trusting the tools to do what seems like the obviously right thing to
do.

If GCC lets us down, we could try something like the yesno version in
drivers/net/ethernet/chelsio/cxgb4/cxgb4_debugfs.c. GCC not doing the
right thing with that would be violating the standard.

BR,
Jani.

> -Chris
>
> --
> Chris Wilson, Intel Open Source Technology Centre

--
Jani Nikula, Intel Open Source Technology Center