devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] of: of_match_node: Make stub an inline function to avoid W=1 warnings
@ 2020-08-28  2:19 Andrew Lunn
  2020-08-28 10:52 ` kernel test robot
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Andrew Lunn @ 2020-08-28  2:19 UTC (permalink / raw)
  To: robh+dt; +Cc: devicetree, linux-kernel, Andrew Lunn

When building without CONFIG_OF and W=1, errors are given about unused
arrays of match data, because of_match_node is stubbed as a macro. The
compile does not see it takes parameters when not astub, so it
generates warnings about unused variables. Replace the stub with an
inline function to avoid these false warnings.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
---
 include/linux/of.h | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/include/linux/of.h b/include/linux/of.h
index 5cf7ae0465d1..e9838387e7d9 100644
--- a/include/linux/of.h
+++ b/include/linux/of.h
@@ -991,7 +991,12 @@ static inline int of_map_id(struct device_node *np, u32 id,
 }
 
 #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.28.0


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2020-08-30 20:15 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-08-28  2:19 [PATCH] of: of_match_node: Make stub an inline function to avoid W=1 warnings Andrew Lunn
2020-08-28 10:52 ` kernel test robot
2020-08-28 11:05 ` kernel test robot
2020-08-28 13:00 ` Andrew Lunn
2020-08-28 23:09   ` Rob Herring
2020-08-30 15:23     ` Andrew Lunn
2020-08-30 20:15       ` Andy Shevchenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).