Commit 7ec7fb394298c212c30e063c57e0aa895efe9439
Committed by
Linus Torvalds
1 parent
9fe06081ef
Exists in
master
and in
39 other branches
samples: mark {static|__init|__exit} for {init|exit} functions
None of these (init|exit) functions is called from other functions which is outside the kernel module mechanism or kernel itself, so mark them as {static|__init|__exit}. Signed-off-by: Qinghuang Feng <qhfeng.kernel@gmail.com> Cc: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca> Acked-by: Greg Kroah-Hartman <gregkh@suse.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Showing 7 changed files with 13 additions and 13 deletions Side-by-side Diff
samples/firmware_class/firmware_sample_driver.c
samples/kobject/kobject-example.c
... | ... | @@ -101,7 +101,7 @@ |
101 | 101 | |
102 | 102 | static struct kobject *example_kobj; |
103 | 103 | |
104 | -static int example_init(void) | |
104 | +static int __init example_init(void) | |
105 | 105 | { |
106 | 106 | int retval; |
107 | 107 | |
... | ... | @@ -126,7 +126,7 @@ |
126 | 126 | return retval; |
127 | 127 | } |
128 | 128 | |
129 | -static void example_exit(void) | |
129 | +static void __exit example_exit(void) | |
130 | 130 | { |
131 | 131 | kobject_put(example_kobj); |
132 | 132 | } |
samples/kobject/kset-example.c
... | ... | @@ -229,7 +229,7 @@ |
229 | 229 | kobject_put(&foo->kobj); |
230 | 230 | } |
231 | 231 | |
232 | -static int example_init(void) | |
232 | +static int __init example_init(void) | |
233 | 233 | { |
234 | 234 | /* |
235 | 235 | * Create a kset with the name of "kset_example", |
... | ... | @@ -264,7 +264,7 @@ |
264 | 264 | return -EINVAL; |
265 | 265 | } |
266 | 266 | |
267 | -static void example_exit(void) | |
267 | +static void __exit example_exit(void) | |
268 | 268 | { |
269 | 269 | destroy_foo_obj(baz_obj); |
270 | 270 | destroy_foo_obj(bar_obj); |
samples/markers/marker-example.c
... | ... | @@ -30,7 +30,7 @@ |
30 | 30 | .open = my_open, |
31 | 31 | }; |
32 | 32 | |
33 | -static int example_init(void) | |
33 | +static int __init example_init(void) | |
34 | 34 | { |
35 | 35 | printk(KERN_ALERT "example init\n"); |
36 | 36 | pentry_example = proc_create("marker-example", 0444, NULL, &mark_ops); |
... | ... | @@ -39,7 +39,7 @@ |
39 | 39 | return 0; |
40 | 40 | } |
41 | 41 | |
42 | -static void example_exit(void) | |
42 | +static void __exit example_exit(void) | |
43 | 43 | { |
44 | 44 | printk(KERN_ALERT "example exit\n"); |
45 | 45 | remove_proc_entry("marker-example", NULL); |
samples/tracepoints/tracepoint-probe-sample.c
... | ... | @@ -28,7 +28,7 @@ |
28 | 28 | printk(KERN_INFO "Event B is encountered\n"); |
29 | 29 | } |
30 | 30 | |
31 | -int __init tp_sample_trace_init(void) | |
31 | +static int __init tp_sample_trace_init(void) | |
32 | 32 | { |
33 | 33 | int ret; |
34 | 34 | |
... | ... | @@ -42,7 +42,7 @@ |
42 | 42 | |
43 | 43 | module_init(tp_sample_trace_init); |
44 | 44 | |
45 | -void __exit tp_sample_trace_exit(void) | |
45 | +static void __exit tp_sample_trace_exit(void) | |
46 | 46 | { |
47 | 47 | unregister_trace_subsys_eventb(probe_subsys_eventb); |
48 | 48 | unregister_trace_subsys_event(probe_subsys_event); |
samples/tracepoints/tracepoint-probe-sample2.c
... | ... | @@ -18,7 +18,7 @@ |
18 | 18 | inode->i_ino); |
19 | 19 | } |
20 | 20 | |
21 | -int __init tp_sample_trace_init(void) | |
21 | +static int __init tp_sample_trace_init(void) | |
22 | 22 | { |
23 | 23 | int ret; |
24 | 24 | |
... | ... | @@ -30,7 +30,7 @@ |
30 | 30 | |
31 | 31 | module_init(tp_sample_trace_init); |
32 | 32 | |
33 | -void __exit tp_sample_trace_exit(void) | |
33 | +static void __exit tp_sample_trace_exit(void) | |
34 | 34 | { |
35 | 35 | unregister_trace_subsys_event(probe_subsys_event); |
36 | 36 | tracepoint_synchronize_unregister(); |
samples/tracepoints/tracepoint-sample.c
... | ... | @@ -32,7 +32,7 @@ |
32 | 32 | .open = my_open, |
33 | 33 | }; |
34 | 34 | |
35 | -static int example_init(void) | |
35 | +static int __init example_init(void) | |
36 | 36 | { |
37 | 37 | printk(KERN_ALERT "example init\n"); |
38 | 38 | pentry_example = proc_create("tracepoint-example", 0444, NULL, |
... | ... | @@ -42,7 +42,7 @@ |
42 | 42 | return 0; |
43 | 43 | } |
44 | 44 | |
45 | -static void example_exit(void) | |
45 | +static void __exit example_exit(void) | |
46 | 46 | { |
47 | 47 | printk(KERN_ALERT "example exit\n"); |
48 | 48 | remove_proc_entry("tracepoint-example", NULL); |