[PATCH v7 1/3] backlight: Add IS_ENABLED(CONFIG_BACKLIGHT_CLASS_DEVICE)

Daniel Thompson daniel.thompson at linaro.org
Mon Oct 2 09:36:45 UTC 2017


On 02/10/17 09:49, Jani Nikula wrote:
> On Mon, 02 Oct 2017, Daniel Thompson <daniel.thompson at linaro.org> wrote:
>> On 01/10/17 18:26, Meghana Madhyastha wrote:
>>> -#ifdef CONFIG_OF
>>> +#if defined CONFIG_OF && IS_ENABLED(CONFIG_BACKLIGHT_CLASS_DEVICE)
>>
>> The above comments are more important but why does this mix defined and
>> IS_ENABLED? Couldn't they both use defined (and preferably with the
>> optional brackets around the CONFIG_ symbol).
> 
> No, always use IS_ENABLED() for tristates when you want to match 'y' or
> 'm'.

Oops.

Actually it was the mis-match in the original code that attracted my 
attention (defined on one side, IS_ENABLED() on the other)... I'd be 
happier if both used the same approach.


Daniel.


More information about the dri-devel mailing list