Commit 7ec7fb39 authored by Qinghuang Feng's avatar Qinghuang Feng Committed by Linus Torvalds

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: default avatarQinghuang Feng <qhfeng.kernel@gmail.com>
Cc: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
Acked-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 9fe06081
...@@ -100,7 +100,7 @@ static void sample_probe_async(void) ...@@ -100,7 +100,7 @@ static void sample_probe_async(void)
" request_firmware_nowait failed\n"); " request_firmware_nowait failed\n");
} }
static int sample_init(void) static int __init sample_init(void)
{ {
device_initialize(&ghost_device); device_initialize(&ghost_device);
/* since there is no real hardware insertion I just call the /* since there is no real hardware insertion I just call the
......
...@@ -101,7 +101,7 @@ static struct attribute_group attr_group = { ...@@ -101,7 +101,7 @@ static struct attribute_group attr_group = {
static struct kobject *example_kobj; static struct kobject *example_kobj;
static int example_init(void) static int __init example_init(void)
{ {
int retval; int retval;
...@@ -126,7 +126,7 @@ static int example_init(void) ...@@ -126,7 +126,7 @@ static int example_init(void)
return retval; return retval;
} }
static void example_exit(void) static void __exit example_exit(void)
{ {
kobject_put(example_kobj); kobject_put(example_kobj);
} }
......
...@@ -229,7 +229,7 @@ static void destroy_foo_obj(struct foo_obj *foo) ...@@ -229,7 +229,7 @@ static void destroy_foo_obj(struct foo_obj *foo)
kobject_put(&foo->kobj); kobject_put(&foo->kobj);
} }
static int example_init(void) static int __init example_init(void)
{ {
/* /*
* Create a kset with the name of "kset_example", * Create a kset with the name of "kset_example",
...@@ -264,7 +264,7 @@ static int example_init(void) ...@@ -264,7 +264,7 @@ static int example_init(void)
return -EINVAL; return -EINVAL;
} }
static void example_exit(void) static void __exit example_exit(void)
{ {
destroy_foo_obj(baz_obj); destroy_foo_obj(baz_obj);
destroy_foo_obj(bar_obj); destroy_foo_obj(bar_obj);
......
...@@ -30,7 +30,7 @@ static struct file_operations mark_ops = { ...@@ -30,7 +30,7 @@ static struct file_operations mark_ops = {
.open = my_open, .open = my_open,
}; };
static int example_init(void) static int __init example_init(void)
{ {
printk(KERN_ALERT "example init\n"); printk(KERN_ALERT "example init\n");
pentry_example = proc_create("marker-example", 0444, NULL, &mark_ops); pentry_example = proc_create("marker-example", 0444, NULL, &mark_ops);
...@@ -39,7 +39,7 @@ static int example_init(void) ...@@ -39,7 +39,7 @@ static int example_init(void)
return 0; return 0;
} }
static void example_exit(void) static void __exit example_exit(void)
{ {
printk(KERN_ALERT "example exit\n"); printk(KERN_ALERT "example exit\n");
remove_proc_entry("marker-example", NULL); remove_proc_entry("marker-example", NULL);
......
...@@ -28,7 +28,7 @@ static void probe_subsys_eventb(void) ...@@ -28,7 +28,7 @@ static void probe_subsys_eventb(void)
printk(KERN_INFO "Event B is encountered\n"); printk(KERN_INFO "Event B is encountered\n");
} }
int __init tp_sample_trace_init(void) static int __init tp_sample_trace_init(void)
{ {
int ret; int ret;
...@@ -42,7 +42,7 @@ int __init tp_sample_trace_init(void) ...@@ -42,7 +42,7 @@ int __init tp_sample_trace_init(void)
module_init(tp_sample_trace_init); module_init(tp_sample_trace_init);
void __exit tp_sample_trace_exit(void) static void __exit tp_sample_trace_exit(void)
{ {
unregister_trace_subsys_eventb(probe_subsys_eventb); unregister_trace_subsys_eventb(probe_subsys_eventb);
unregister_trace_subsys_event(probe_subsys_event); unregister_trace_subsys_event(probe_subsys_event);
......
...@@ -18,7 +18,7 @@ static void probe_subsys_event(struct inode *inode, struct file *file) ...@@ -18,7 +18,7 @@ static void probe_subsys_event(struct inode *inode, struct file *file)
inode->i_ino); inode->i_ino);
} }
int __init tp_sample_trace_init(void) static int __init tp_sample_trace_init(void)
{ {
int ret; int ret;
...@@ -30,7 +30,7 @@ int __init tp_sample_trace_init(void) ...@@ -30,7 +30,7 @@ int __init tp_sample_trace_init(void)
module_init(tp_sample_trace_init); module_init(tp_sample_trace_init);
void __exit tp_sample_trace_exit(void) static void __exit tp_sample_trace_exit(void)
{ {
unregister_trace_subsys_event(probe_subsys_event); unregister_trace_subsys_event(probe_subsys_event);
tracepoint_synchronize_unregister(); tracepoint_synchronize_unregister();
......
...@@ -32,7 +32,7 @@ static struct file_operations mark_ops = { ...@@ -32,7 +32,7 @@ static struct file_operations mark_ops = {
.open = my_open, .open = my_open,
}; };
static int example_init(void) static int __init example_init(void)
{ {
printk(KERN_ALERT "example init\n"); printk(KERN_ALERT "example init\n");
pentry_example = proc_create("tracepoint-example", 0444, NULL, pentry_example = proc_create("tracepoint-example", 0444, NULL,
...@@ -42,7 +42,7 @@ static int example_init(void) ...@@ -42,7 +42,7 @@ static int example_init(void)
return 0; return 0;
} }
static void example_exit(void) static void __exit example_exit(void)
{ {
printk(KERN_ALERT "example exit\n"); printk(KERN_ALERT "example exit\n");
remove_proc_entry("tracepoint-example", NULL); remove_proc_entry("tracepoint-example", NULL);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment