Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1571750 > unrolled thread

[PATCH] tracing/kprobes: fix __init annotation

Started byArnd Bergmann <arnd@arndb.de>
First post2017-02-01 18:00 +0100
Last post2017-02-06 03:30 +0100
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] tracing/kprobes: fix __init annotation Arnd Bergmann <arnd@arndb.de> - 2017-02-01 18:00 +0100
    Re: [PATCH] tracing/kprobes: fix __init annotation Masami Hiramatsu <mhiramat@kernel.org> - 2017-02-06 03:30 +0100

#1571750 — [PATCH] tracing/kprobes: fix __init annotation

FromArnd Bergmann <arnd@arndb.de>
Date2017-02-01 18:00 +0100
Subject[PATCH] tracing/kprobes: fix __init annotation
Message-ID<t66qf-8ov-49@gated-at.bofh.it>
clang complains about "__init" being attached to a struct name:

kernel/trace/trace_kprobe.c:1375:15: error: '__section__' attribute only applies to functions and global variables

The intention must have been to mark the function as __init instead of
the type, so move the attribute there.

Fixes: f18f97ac43d7 ("tracing/kprobes: Add a helper method to return number of probe hits")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 kernel/trace/trace_kprobe.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/trace/trace_kprobe.c b/kernel/trace/trace_kprobe.c
index a133ecd741e4..7ad9e53ad174 100644
--- a/kernel/trace/trace_kprobe.c
+++ b/kernel/trace/trace_kprobe.c
@@ -1372,7 +1372,7 @@ kprobe_trace_selftest_target(int a1, int a2, int a3, int a4, int a5, int a6)
 	return a1 + a2 + a3 + a4 + a5 + a6;
 }
 
-static struct __init trace_event_file *
+static __init struct trace_event_file *
 find_trace_probe_file(struct trace_kprobe *tk, struct trace_array *tr)
 {
 	struct trace_event_file *file;
-- 
2.9.0

[toc] | [next] | [standalone]


#1574332

FromMasami Hiramatsu <mhiramat@kernel.org>
Date2017-02-06 03:30 +0100
Message-ID<t7He1-79o-11@gated-at.bofh.it>
In reply to#1571750
On Wed,  1 Feb 2017 17:57:56 +0100
Arnd Bergmann <arnd@arndb.de> wrote:

> clang complains about "__init" being attached to a struct name:
> 
> kernel/trace/trace_kprobe.c:1375:15: error: '__section__' attribute only applies to functions and global variables
> 
> The intention must have been to mark the function as __init instead of
> the type, so move the attribute there.
> 
> Fixes: f18f97ac43d7 ("tracing/kprobes: Add a helper method to return number of probe hits")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Looks good to me.

Acked-by: Masami Hiramatsu <mhiramat@kernel.org>

Thanks!

> ---
>  kernel/trace/trace_kprobe.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/kernel/trace/trace_kprobe.c b/kernel/trace/trace_kprobe.c
> index a133ecd741e4..7ad9e53ad174 100644
> --- a/kernel/trace/trace_kprobe.c
> +++ b/kernel/trace/trace_kprobe.c
> @@ -1372,7 +1372,7 @@ kprobe_trace_selftest_target(int a1, int a2, int a3, int a4, int a5, int a6)
>  	return a1 + a2 + a3 + a4 + a5 + a6;
>  }
>  
> -static struct __init trace_event_file *
> +static __init struct trace_event_file *
>  find_trace_probe_file(struct trace_kprobe *tk, struct trace_array *tr)
>  {
>  	struct trace_event_file *file;
> -- 
> 2.9.0
> 


-- 
Masami Hiramatsu <mhiramat@kernel.org>

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web