* [PATCH] net: davinci: fix building davinci mdio code without CONFIG_OF
@ 2018-05-28 15:50 Arnd Bergmann
2018-05-29 13:25 ` Sekhar Nori
2018-05-30 17:22 ` David Miller
0 siblings, 2 replies; 5+ messages in thread
From: Arnd Bergmann @ 2018-05-28 15:50 UTC (permalink / raw)
To: David S. Miller
Cc: Arnd Bergmann, Grygorii Strashko, Sekhar Nori, Florian Fainelli,
linux-omap, netdev, linux-kernel
Test-building this driver on targets without CONFIG_OF revealed a build
failure:
drivers/net/ethernet/ti/davinci_mdio.c: In function 'davinci_mdio_probe':
drivers/net/ethernet/ti/davinci_mdio.c:380:9: error: implicit declaration of function 'davinci_mdio_probe_dt'; did you mean 'davinci_mdio_probe'? [-Werror=implicit-function-declaration]
This adjusts the #ifdef logic in the driver to make it build in
all configurations.
Fixes: 2652113ff043 ("net: ethernet: ti: Allow most drivers with COMPILE_TEST")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
drivers/net/ethernet/ti/davinci_mdio.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/ti/davinci_mdio.c b/drivers/net/ethernet/ti/davinci_mdio.c
index 8ac72831af05..a98aedae1b41 100644
--- a/drivers/net/ethernet/ti/davinci_mdio.c
+++ b/drivers/net/ethernet/ti/davinci_mdio.c
@@ -321,7 +321,6 @@ static int davinci_mdio_write(struct mii_bus *bus, int phy_id,
return ret;
}
-#if IS_ENABLED(CONFIG_OF)
static int davinci_mdio_probe_dt(struct mdio_platform_data *data,
struct platform_device *pdev)
{
@@ -339,7 +338,6 @@ static int davinci_mdio_probe_dt(struct mdio_platform_data *data,
return 0;
}
-#endif
#if IS_ENABLED(CONFIG_OF)
static const struct davinci_mdio_of_param of_cpsw_mdio_data = {
@@ -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);
--
2.9.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] net: davinci: fix building davinci mdio code without CONFIG_OF
2018-05-28 15:50 [PATCH] net: davinci: fix building davinci mdio code without CONFIG_OF Arnd Bergmann
@ 2018-05-29 13:25 ` Sekhar Nori
2018-05-30 17:22 ` David Miller
1 sibling, 0 replies; 5+ messages in thread
From: Sekhar Nori @ 2018-05-29 13:25 UTC (permalink / raw)
To: Arnd Bergmann, David S. Miller
Cc: Grygorii Strashko, Florian Fainelli, linux-omap, netdev, linux-kernel
Hi Arnd,
On Monday 28 May 2018 09:20 PM, Arnd Bergmann wrote:
> Test-building this driver on targets without CONFIG_OF revealed a build
> failure:
>
> drivers/net/ethernet/ti/davinci_mdio.c: In function 'davinci_mdio_probe':
> drivers/net/ethernet/ti/davinci_mdio.c:380:9: error: implicit declaration of function 'davinci_mdio_probe_dt'; did you mean 'davinci_mdio_probe'? [-Werror=implicit-function-declaration]
>
> This adjusts the #ifdef logic in the driver to make it build in
> all configurations.
>
> Fixes: 2652113ff043 ("net: ethernet: ti: Allow most drivers with COMPILE_TEST")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Your patch fixes the issue.
Acked-by: Sekhar Nori <nsekhar@ti.com>
One question below:
> ---
> drivers/net/ethernet/ti/davinci_mdio.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/drivers/net/ethernet/ti/davinci_mdio.c b/drivers/net/ethernet/ti/davinci_mdio.c
> index 8ac72831af05..a98aedae1b41 100644
> --- a/drivers/net/ethernet/ti/davinci_mdio.c
> +++ b/drivers/net/ethernet/ti/davinci_mdio.c
> @@ -321,7 +321,6 @@ static int davinci_mdio_write(struct mii_bus *bus, int phy_id,
> return ret;
> }
>
> -#if IS_ENABLED(CONFIG_OF)
> static int davinci_mdio_probe_dt(struct mdio_platform_data *data,
> struct platform_device *pdev)
> {
> @@ -339,7 +338,6 @@ static int davinci_mdio_probe_dt(struct mdio_platform_data *data,
>
> return 0;
> }
> -#endif
>
> #if IS_ENABLED(CONFIG_OF)
> static const struct davinci_mdio_of_param of_cpsw_mdio_data = {
> @@ -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.
Thanks,
Sekhar
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] net: davinci: fix building davinci mdio code without CONFIG_OF
@ 2018-05-29 13:25 ` Sekhar Nori
0 siblings, 0 replies; 5+ messages in thread
From: Sekhar Nori @ 2018-05-29 13:25 UTC (permalink / raw)
To: Arnd Bergmann, David S. Miller
Cc: Grygorii Strashko, Florian Fainelli, linux-omap, netdev, linux-kernel
Hi Arnd,
On Monday 28 May 2018 09:20 PM, Arnd Bergmann wrote:
> Test-building this driver on targets without CONFIG_OF revealed a build
> failure:
>
> drivers/net/ethernet/ti/davinci_mdio.c: In function 'davinci_mdio_probe':
> drivers/net/ethernet/ti/davinci_mdio.c:380:9: error: implicit declaration of function 'davinci_mdio_probe_dt'; did you mean 'davinci_mdio_probe'? [-Werror=implicit-function-declaration]
>
> This adjusts the #ifdef logic in the driver to make it build in
> all configurations.
>
> Fixes: 2652113ff043 ("net: ethernet: ti: Allow most drivers with COMPILE_TEST")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Your patch fixes the issue.
Acked-by: Sekhar Nori <nsekhar@ti.com>
One question below:
> ---
> drivers/net/ethernet/ti/davinci_mdio.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/drivers/net/ethernet/ti/davinci_mdio.c b/drivers/net/ethernet/ti/davinci_mdio.c
> index 8ac72831af05..a98aedae1b41 100644
> --- a/drivers/net/ethernet/ti/davinci_mdio.c
> +++ b/drivers/net/ethernet/ti/davinci_mdio.c
> @@ -321,7 +321,6 @@ static int davinci_mdio_write(struct mii_bus *bus, int phy_id,
> return ret;
> }
>
> -#if IS_ENABLED(CONFIG_OF)
> static int davinci_mdio_probe_dt(struct mdio_platform_data *data,
> struct platform_device *pdev)
> {
> @@ -339,7 +338,6 @@ static int davinci_mdio_probe_dt(struct mdio_platform_data *data,
>
> return 0;
> }
> -#endif
>
> #if IS_ENABLED(CONFIG_OF)
> static const struct davinci_mdio_of_param of_cpsw_mdio_data = {
> @@ -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.
Thanks,
Sekhar
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] net: davinci: fix building davinci mdio code without CONFIG_OF
2018-05-29 13:25 ` Sekhar Nori
(?)
@ 2018-05-29 14:31 ` Arnd Bergmann
-1 siblings, 0 replies; 5+ messages in thread
From: Arnd Bergmann @ 2018-05-29 14:31 UTC (permalink / raw)
To: Sekhar Nori
Cc: David S. Miller, Grygorii Strashko, Florian Fainelli, linux-omap,
Networking, Linux Kernel Mailing List
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
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] net: davinci: fix building davinci mdio code without CONFIG_OF
2018-05-28 15:50 [PATCH] net: davinci: fix building davinci mdio code without CONFIG_OF Arnd Bergmann
2018-05-29 13:25 ` Sekhar Nori
@ 2018-05-30 17:22 ` David Miller
1 sibling, 0 replies; 5+ messages in thread
From: David Miller @ 2018-05-30 17:22 UTC (permalink / raw)
To: arnd
Cc: grygorii.strashko, nsekhar, f.fainelli, linux-omap, netdev, linux-kernel
From: Arnd Bergmann <arnd@arndb.de>
Date: Mon, 28 May 2018 17:50:20 +0200
> Test-building this driver on targets without CONFIG_OF revealed a build
> failure:
>
> drivers/net/ethernet/ti/davinci_mdio.c: In function 'davinci_mdio_probe':
> drivers/net/ethernet/ti/davinci_mdio.c:380:9: error: implicit declaration of function 'davinci_mdio_probe_dt'; did you mean 'davinci_mdio_probe'? [-Werror=implicit-function-declaration]
>
> This adjusts the #ifdef logic in the driver to make it build in
> all configurations.
>
> Fixes: 2652113ff043 ("net: ethernet: ti: Allow most drivers with COMPILE_TEST")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Applied to net-next.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2018-05-30 17:22 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-28 15:50 [PATCH] net: davinci: fix building davinci mdio code without CONFIG_OF Arnd Bergmann
2018-05-29 13:25 ` Sekhar Nori
2018-05-29 13:25 ` Sekhar Nori
2018-05-29 14:31 ` Arnd Bergmann
2018-05-30 17:22 ` David Miller
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.