Skip to contentSkip to conversation

tracing/kprobes: fix __init annotation

PATCH In review Arnd Bergmann 2 participants 2 messages Feb 1, 2017 – Feb 6, 2017 Tracing

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tracing/kprobes: fix __init annotation

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")
---
 kernel/trace/trace_kprobe.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/trace/trace_kprobe.c +1 -1
index a133ecd741e4..7ad9e53ad174 100644
@@ -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;
Signature · 1 line
2.9.0
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 9 lines · On Wed, 1 Feb 2017 17:57:56 +0100 Arnd Bergmann <[email protected]> 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")

Looks good to me.

Thanks!

Quoted 20 lines
---
 kernel/trace/trace_kprobe.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/trace/trace_kprobe.c +1 -1
index a133ecd741e4..7ad9e53ad174 100644
@@ -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;
Signature · 1 line
2.9.0
Signature · 1 line
Masami Hiramatsu <[email protected]>