[PATCH] of: Move of_skipped_node_table within #ifdef CONFIG_OF_ADDRESS

From: Viresh Kumar
Date: Tue Aug 22 2023 - 03:57:42 EST


The `struct of_skipped_node_table` is used only when CONFIG_OF_ADDRESS
is defined, move it within the #ifdef/#endif to avoid warnings on
configurations where CONFIG_OF_ADDRESS isn't defined.

Reported-by: kernel test robot <lkp@xxxxxxxxx>
Closes: https://lore.kernel.org/oe-kbuild-all/202308212037.YopffWSU-lkp@xxxxxxxxx/
Signed-off-by: Viresh Kumar <viresh.kumar@xxxxxxxxxx>
---
drivers/of/platform.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/of/platform.c b/drivers/of/platform.c
index 051e29b7ad2b..3f7bdf7bc2f8 100644
--- a/drivers/of/platform.c
+++ b/drivers/of/platform.c
@@ -31,11 +31,6 @@ const struct of_device_id of_default_bus_match_table[] = {
{} /* Empty terminated list */
};

-static const struct of_device_id of_skipped_node_table[] = {
- { .compatible = "operating-points-v2", },
- {} /* Empty terminated list */
-};
-
/**
* of_find_device_by_node - Find the platform_device associated with a node
* @np: Pointer to device tree node
@@ -55,6 +50,11 @@ struct platform_device *of_find_device_by_node(struct device_node *np)
EXPORT_SYMBOL(of_find_device_by_node);

#ifdef CONFIG_OF_ADDRESS
+static const struct of_device_id of_skipped_node_table[] = {
+ { .compatible = "operating-points-v2", },
+ {} /* Empty terminated list */
+};
+
/*
* The following routines scan a subtree and registers a device for
* each applicable node.
--
2.31.1.272.g89b43f80a514