Skip to contentSkip to conversation

of: unittest: move misplaced function declaration

PATCH Applied Arnd Bergmann 2 participants 2 messages Mar 13, 2018 – Mar 18, 2018 Device tree

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 of: unittest: move misplaced function declaration

The overlay_data_apply() declaration is outside of the #ifdef that contains both the user and the definition, causing a compile-time warning in some configurations:

drivers/of/unittest.c:48:19: error: 'overlay_data_apply' declared 'static' but never defined [-Werror=unused-function]
static int __init overlay_data_apply(const char *overlay_name, int *overlay_id);

This moves the declaration into the #ifdef section.

Fixes 39a751a4cb7e ("of: change overlay apply input data from unflattened to FDT")
---
 drivers/of/unittest.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/of/unittest.c +1 -2
index dede77a79820..260d5245491b 100644
@@ -45,8 +45,6 @@ static struct unittest_results {
 	failed; \
 })
 
-static int __init overlay_data_apply(const char *overlay_name, int *overlay_id);
-
 static void __init of_unittest_find_node_by_name(void)
 {
 	struct device_node *np;
@@ -1185,6 +1183,7 @@ static int __init unittest_data_add(void)
 }
 
 #ifdef CONFIG_OF_OVERLAY
+static int __init overlay_data_apply(const char *overlay_name, int *overlay_id);
 
 static int unittest_probe(struct platform_device *pdev)
 {
Signature · 1 line
2.9.0
maintainer Applied
#1 lore raw
Quoted 7 lines · Arnd Bergmann

The overlay_data_apply() declaration is outside of the #ifdef that contains both the user and the definition, causing a compile-time warning in some configurations:

drivers/of/unittest.c:48:19: error: 'overlay_data_apply' declared 'static' but never defined [-Werror=unused-function]
static int __init overlay_data_apply(const char *overlay_name, int *overlay_id);

Quoted 7 lines

This moves the declaration into the #ifdef section.

Fixes 39a751a4cb7e ("of: change overlay apply input data from unflattened to FDT")
---
 drivers/of/unittest.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Applied.