Re: [PATCH 25/46] kernel: Add prototype declaration to header file include/linux/ftrace.h

Steven Rostedt
2014-02-27T19:37:56Z

On Thu, 27 Feb 2014 17:32:47 +0530
Rashika Kheria <rashika.kheria@gmail.com> wrote:

> Add prototype declaration of function to header file
> include/linux/ftrace.h because it is used by more than one file.
>
> This eliminates the following warning in kernel/trace/ftrace.c:
> kernel/trace/ftrace.c:4914:5: warning: no previous prototype for ‘ftrace_graph_entry_stub’ [-Wmissing-prototypes]
>
> Signed-off-by: Rashika Kheria <rashika.kheria@gmail.com>
> Reviewed-by: Josh Triplett <josh@joshtriplett.org>
> ---
> include/linux/ftrace.h | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h
> index 68ea184..da1c31f 100644
> --- a/include/linux/ftrace.h
> +++ b/include/linux/ftrace.h
> @@ -672,6 +672,8 @@ struct ftrace_graph_ret {
> typedef void (*trace_func_graph_ret_t)(struct ftrace_graph_ret *); /* return */
> typedef int (*trace_func_graph_ent_t)(struct ftrace_graph_ent *); /* entry */
>
> +int ftrace_graph_entry_stub(struct ftrace_graph_ent *trace);

This doesn't need to be in a header file as it is only called by
assmebly. But I have no problems with it being in one, but it should
have a comment stating this:

/* This is only called by assembly code, declared here for consistency */

-- Steve

> +
> #ifdef CONFIG_FUNCTION_GRAPH_TRACER
>
> /* for init task */