lkml.org 
[lkml]   [2018]   [May]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH] net: davinci: fix building davinci mdio code without CONFIG_OF
On Tue, May 29, 2018 at 3:25 PM, Sekhar Nori <nsekhar@ti.com> wrote:

>> @@ -374,7 +372,7 @@ static int davinci_mdio_probe(struct platform_device *pdev)
>> return -ENOMEM;
>> }
>>
>> - if (dev->of_node) {
>> + if (IS_ENABLED(CONFIG_OF) && dev->of_node) {
>> const struct of_device_id *of_id;
>>
>> ret = davinci_mdio_probe_dt(&data->pdata, pdev);
>
> I was expecting this one change to fix the issue since the if() block
> should be compiled away removing references to davinci_mdio_probe_dt().
>
> The code does get compiled out and there are no references to
> davinci_mdio_probe_dt() in the final object when !CONFIG_OF.
>
> But the compile error remains if the #ifdefs you removed above are
> installed back. Not sure why.

The way that "if (IS_ENABLED())" works, everything gets compiled at
first, but then the compiler uses dead code elimination to remove it
from the output after verifying that everything builds.

Arnd

\
 
 \ /
  Last update: 2018-05-29 16:32    [W:0.045 / U:3.388 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site