* [PATCH v2 1/3] mfd: max8998: Remove CONFIG_OF around max8998_dt_match
2017-04-12 4:41 [PATCH v2 0/3] of: Make of_match_node() an inline stub for CONFIG_OF=n Florian Fainelli
@ 2017-04-12 4:41 ` Florian Fainelli
[not found] ` <20170412044156.17351-2-f.fainelli-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-04-12 4:41 ` [PATCH v2 2/3] net: macb: Remove CONFIG_OF around DT match table Florian Fainelli
` (2 subsequent siblings)
3 siblings, 1 reply; 9+ messages in thread
From: Florian Fainelli @ 2017-04-12 4:41 UTC (permalink / raw)
To: linux-kernel
Cc: andrew, vivien.didelot, Florian Fainelli, Lee Jones,
Nicolas Ferre, Rob Herring, Frank Rowand,
open list:NETWORKING DRIVERS,
open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE
A subsequent patch is going to make of_match_node() an inline stub when
CONFIG_OF is disabled which will properly take care of having the compiler
eliminate the variable. To avoid more #ifdef/#else, just always make the match
table available.
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
drivers/mfd/max8998.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/drivers/mfd/max8998.c b/drivers/mfd/max8998.c
index 4c33b8063bc3..372f681ec1bb 100644
--- a/drivers/mfd/max8998.c
+++ b/drivers/mfd/max8998.c
@@ -129,14 +129,12 @@ int max8998_update_reg(struct i2c_client *i2c, u8 reg, u8 val, u8 mask)
}
EXPORT_SYMBOL(max8998_update_reg);
-#ifdef CONFIG_OF
static const struct of_device_id max8998_dt_match[] = {
{ .compatible = "maxim,max8998", .data = (void *)TYPE_MAX8998 },
{ .compatible = "national,lp3974", .data = (void *)TYPE_LP3974 },
{ .compatible = "ti,lp3974", .data = (void *)TYPE_LP3974 },
{},
};
-#endif
/*
* Only the common platform data elements for max8998 are parsed here from the
--
2.9.3
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH v2 2/3] net: macb: Remove CONFIG_OF around DT match table
2017-04-12 4:41 [PATCH v2 0/3] of: Make of_match_node() an inline stub for CONFIG_OF=n Florian Fainelli
2017-04-12 4:41 ` [PATCH v2 1/3] mfd: max8998: Remove CONFIG_OF around max8998_dt_match Florian Fainelli
@ 2017-04-12 4:41 ` Florian Fainelli
2017-04-12 20:51 ` Rob Herring
2017-04-12 4:41 ` [PATCH v2 3/3] of: Make of_match_node() an inline stub for CONFIG_OF=n Florian Fainelli
[not found] ` <20170412044156.17351-1-f.fainelli-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
3 siblings, 1 reply; 9+ messages in thread
From: Florian Fainelli @ 2017-04-12 4:41 UTC (permalink / raw)
To: linux-kernel
Cc: andrew, vivien.didelot, Florian Fainelli, Lee Jones,
Nicolas Ferre, Rob Herring, Frank Rowand,
open list:NETWORKING DRIVERS,
open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE
A subsequent patch is going to make of_match_node() an inline stub when
CONFIG_OF is disabled, which will let the compiler eliminate unused variables.
In order not to clutter the code more, remove the CONFIG_OF #ifdef such that
macb_dt_ids and what it references are always defined.
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
drivers/net/ethernet/cadence/macb.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/drivers/net/ethernet/cadence/macb.c b/drivers/net/ethernet/cadence/macb.c
index 30606b11b128..01016e9525ee 100644
--- a/drivers/net/ethernet/cadence/macb.c
+++ b/drivers/net/ethernet/cadence/macb.c
@@ -2811,7 +2811,6 @@ static int macb_init(struct platform_device *pdev)
return 0;
}
-#if defined(CONFIG_OF)
/* 1518 rounded up */
#define AT91ETHER_MAX_RBUFF_SZ 0x600
/* max number of receive buffers */
@@ -3215,7 +3214,6 @@ static const struct of_device_id macb_dt_ids[] = {
{ /* sentinel */ }
};
MODULE_DEVICE_TABLE(of, macb_dt_ids);
-#endif /* CONFIG_OF */
static const struct macb_config default_gem_config = {
.caps = MACB_CAPS_GIGABIT_MODE_AVAILABLE | MACB_CAPS_JUMBO,
--
2.9.3
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH v2 2/3] net: macb: Remove CONFIG_OF around DT match table
2017-04-12 4:41 ` [PATCH v2 2/3] net: macb: Remove CONFIG_OF around DT match table Florian Fainelli
@ 2017-04-12 20:51 ` Rob Herring
0 siblings, 0 replies; 9+ messages in thread
From: Rob Herring @ 2017-04-12 20:51 UTC (permalink / raw)
To: Florian Fainelli
Cc: linux-kernel@vger.kernel.org, Andrew Lunn, Vivien Didelot,
Lee Jones, Nicolas Ferre, Frank Rowand,
open list:NETWORKING DRIVERS,
open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE
On Tue, Apr 11, 2017 at 11:41 PM, Florian Fainelli <f.fainelli@gmail.com> wrote:
> A subsequent patch is going to make of_match_node() an inline stub when
> CONFIG_OF is disabled, which will let the compiler eliminate unused variables.
> In order not to clutter the code more, remove the CONFIG_OF #ifdef such that
> macb_dt_ids and what it references are always defined.
>
> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
> ---
> drivers/net/ethernet/cadence/macb.c | 2 --
> 1 file changed, 2 deletions(-)
>
> diff --git a/drivers/net/ethernet/cadence/macb.c b/drivers/net/ethernet/cadence/macb.c
> index 30606b11b128..01016e9525ee 100644
> --- a/drivers/net/ethernet/cadence/macb.c
> +++ b/drivers/net/ethernet/cadence/macb.c
> @@ -2811,7 +2811,6 @@ static int macb_init(struct platform_device *pdev)
> return 0;
> }
>
> -#if defined(CONFIG_OF)
> /* 1518 rounded up */
> #define AT91ETHER_MAX_RBUFF_SZ 0x600
> /* max number of receive buffers */
> @@ -3215,7 +3214,6 @@ static const struct of_device_id macb_dt_ids[] = {
> { /* sentinel */ }
> };
> MODULE_DEVICE_TABLE(of, macb_dt_ids);
Did you actually check that the compiler can eliminate things when
modules are enabled? Because it's not going to be able to eliminate
MODULE_DEVICE_TABLE entry AFAICT.
Rob
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH v2 3/3] of: Make of_match_node() an inline stub for CONFIG_OF=n
2017-04-12 4:41 [PATCH v2 0/3] of: Make of_match_node() an inline stub for CONFIG_OF=n Florian Fainelli
2017-04-12 4:41 ` [PATCH v2 1/3] mfd: max8998: Remove CONFIG_OF around max8998_dt_match Florian Fainelli
2017-04-12 4:41 ` [PATCH v2 2/3] net: macb: Remove CONFIG_OF around DT match table Florian Fainelli
@ 2017-04-12 4:41 ` Florian Fainelli
[not found] ` <20170412044156.17351-4-f.fainelli-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
[not found] ` <20170412044156.17351-1-f.fainelli-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
3 siblings, 1 reply; 9+ messages in thread
From: Florian Fainelli @ 2017-04-12 4:41 UTC (permalink / raw)
To: linux-kernel
Cc: andrew, vivien.didelot, Florian Fainelli, Lee Jones,
Nicolas Ferre, Rob Herring, Frank Rowand,
open list:NETWORKING DRIVERS,
open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE
Make of_match_node() an inline function when CONFIG_OF=n which allows the
compiler to eliminate warnings about unused variables.
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
include/linux/of.h | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/include/linux/of.h b/include/linux/of.h
index 21e6323de0f3..2803a85e81ec 100644
--- a/include/linux/of.h
+++ b/include/linux/of.h
@@ -839,7 +839,11 @@ static inline void of_property_clear_flag(struct property *p, unsigned long flag
}
#define of_match_ptr(_ptr) NULL
-#define of_match_node(_matches, _node) NULL
+static inline const struct of_device_id *of_match_node(
+ const struct of_device_id *matches, const struct device_node *node)
+{
+ return NULL;
+}
#endif /* CONFIG_OF */
/* Default string compare functions, Allow arch asm/prom.h to override */
--
2.9.3
^ permalink raw reply related [flat|nested] 9+ messages in thread
[parent not found: <20170412044156.17351-1-f.fainelli-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>]
* Re: [PATCH v2 0/3] of: Make of_match_node() an inline stub for CONFIG_OF=n
[not found] ` <20170412044156.17351-1-f.fainelli-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
@ 2017-04-12 14:22 ` David Miller
2017-04-13 3:46 ` Frank Rowand
1 sibling, 0 replies; 9+ messages in thread
From: David Miller @ 2017-04-12 14:22 UTC (permalink / raw)
To: f.fainelli-Re5JQEeQqe8AvxtiuMwx3w
Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA, andrew-g2DYL2Zd6BY,
vivien.didelot-4ysUXcep3aM1wj+D4I0NRVaTQe2KTcn/,
lee.jones-QSEj5FYQhm4dnm+yROfE0A,
nicolas.ferre-UWL1GkI3JZL3oGB3hsPCZA,
robh+dt-DgEjT+Ai2ygdnm+yROfE0A,
frowand.list-Re5JQEeQqe8AvxtiuMwx3w,
netdev-u79uwXL29TY76Z2rM5mHXA, devicetree-u79uwXL29TY76Z2rM5mHXA
From: Florian Fainelli <f.fainelli-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Date: Tue, 11 Apr 2017 21:41:53 -0700
> Hi all,
>
> This patch series makes of_match_node() an inline stub for CONFIG_OF=n. kbuild
> reported two build errors which are fixed as preriquisite patches.
>
> This is based on Linus' master, not sure which tree would merge this, Frank's?
I think Frank's would be best. For the series:
Acked-by: David S. Miller <davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v2 0/3] of: Make of_match_node() an inline stub for CONFIG_OF=n
[not found] ` <20170412044156.17351-1-f.fainelli-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-04-12 14:22 ` [PATCH v2 0/3] " David Miller
@ 2017-04-13 3:46 ` Frank Rowand
1 sibling, 0 replies; 9+ messages in thread
From: Frank Rowand @ 2017-04-13 3:46 UTC (permalink / raw)
To: Florian Fainelli, linux-kernel-u79uwXL29TY76Z2rM5mHXA
Cc: andrew-g2DYL2Zd6BY,
vivien.didelot-4ysUXcep3aM1wj+D4I0NRVaTQe2KTcn/, Lee Jones,
Nicolas Ferre, Rob Herring, open list:NETWORKING DRIVERS,
open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE
On 04/11/17 21:41, Florian Fainelli wrote:
> Hi all,
>
> This patch series makes of_match_node() an inline stub for CONFIG_OF=n. kbuild
> reported two build errors which are fixed as preriquisite patches.
>
> This is based on Linus' master, not sure which tree would merge this, Frank's?
It would come in via Rob.
I am not comfortable with patch 3/3 at this moment.
Version 1 of the patch resulted in two errors from the kbuild test robot. This
version results in another error from the kbuild test robot. I know it is a
lot of work, but please look at all of the callers of of_match_node() and
check whether any of the other callers will have the same type of error that
the kbuild test robot is catching.
-Frank
>
> Thanks!
>
> Florian Fainelli (3):
> mfd: max8998: Remove CONFIG_OF around max8998_dt_match
> net: macb: Remove CONFIG_OF around DT match table
> of: Make of_match_node() an inline stub for CONFIG_OF=n
>
> drivers/mfd/max8998.c | 2 --
> drivers/net/ethernet/cadence/macb.c | 2 --
> include/linux/of.h | 6 +++++-
> 3 files changed, 5 insertions(+), 5 deletions(-)
>
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 9+ messages in thread