* [PATCH] Staging: board: Add identifier for 'of_find_all_nodes'
@ 2015-02-20 10:17 Vatika Harlalka
2015-02-20 10:35 ` [Outreachy kernel] " Arnd Bergmann
0 siblings, 1 reply; 2+ messages in thread
From: Vatika Harlalka @ 2015-02-20 10:17 UTC (permalink / raw)
To: outreachy-kernel
This patch fixes sparse errors for this driver related to
identifiers and casting for of_find_all_nodes in linux/of.h library.
Signed-off-by: Vatika Harlalka <vatikaharlalka@gmail.com>
---
drivers/staging/board/board.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/staging/board/board.c b/drivers/staging/board/board.c
index d5a6abc..666e000 100644
--- a/drivers/staging/board/board.c
+++ b/drivers/staging/board/board.c
@@ -5,6 +5,7 @@
#include <linux/of_address.h>
#include "board.h"
+extern struct device_node *of_find_all_nodes(struct device_node *prev);
static bool find_by_address(u64 base_address)
{
struct device_node *dn = of_find_all_nodes(NULL);
--
1.9.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [Outreachy kernel] [PATCH] Staging: board: Add identifier for 'of_find_all_nodes'
2015-02-20 10:17 [PATCH] Staging: board: Add identifier for 'of_find_all_nodes' Vatika Harlalka
@ 2015-02-20 10:35 ` Arnd Bergmann
0 siblings, 0 replies; 2+ messages in thread
From: Arnd Bergmann @ 2015-02-20 10:35 UTC (permalink / raw)
To: outreachy-kernel; +Cc: Vatika Harlalka
On Friday 20 February 2015 15:47:47 Vatika Harlalka wrote:
> This patch fixes sparse errors for this driver related to
> identifiers and casting for of_find_all_nodes in linux/of.h library.
>
> Signed-off-by: Vatika Harlalka <vatikaharlalka@gmail.com>
> ---
> drivers/staging/board/board.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/staging/board/board.c b/drivers/staging/board/board.c
> index d5a6abc..666e000 100644
> --- a/drivers/staging/board/board.c
> +++ b/drivers/staging/board/board.c
> @@ -5,6 +5,7 @@
> #include <linux/of_address.h>
> #include "board.h"
>
> +extern struct device_node *of_find_all_nodes(struct device_node *prev);
> static bool find_by_address(u64 base_address)
> {
> struct device_node *dn = of_find_all_nodes(NULL);
No, you should never add 'extern' declarations to a C file. The rule
is that you need to include the correct header file that contains the
declaration.
In this particular case, the header file is included, but the declaration
is hidden in #ifdef CONFIG_OF, so you should probably make sure the
driver cannot be compiled if CONFIG_OF is disabled.
Arnd
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-02-20 10:35 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-02-20 10:17 [PATCH] Staging: board: Add identifier for 'of_find_all_nodes' Vatika Harlalka
2015-02-20 10:35 ` [Outreachy kernel] " Arnd Bergmann
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.