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>
" 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);
/* since there is no real hardware insertion I just call the
{
device_initialize(&ghost_device);
/* since there is no real hardware insertion I just call the
static struct kobject *example_kobj;
static struct kobject *example_kobj;
-static int example_init(void)
+static int __init example_init(void)
-static void example_exit(void)
+static void __exit example_exit(void)
{
kobject_put(example_kobj);
}
{
kobject_put(example_kobj);
}
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",
-static void example_exit(void)
+static void __exit example_exit(void)
{
destroy_foo_obj(baz_obj);
destroy_foo_obj(bar_obj);
{
destroy_foo_obj(baz_obj);
destroy_foo_obj(bar_obj);
-static int example_init(void)
+static int __init example_init(void)
{
printk(KERN_ALERT "example init\n");
pentry_example = proc_create("marker-example", 0444, NULL, &mark_ops);
{
printk(KERN_ALERT "example init\n");
pentry_example = proc_create("marker-example", 0444, NULL, &mark_ops);
-static void example_exit(void)
+static void __exit example_exit(void)
{
printk(KERN_ALERT "example exit\n");
remove_proc_entry("marker-example", NULL);
{
printk(KERN_ALERT "example exit\n");
remove_proc_entry("marker-example", NULL);
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)
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_event(probe_subsys_event);
{
unregister_trace_subsys_eventb(probe_subsys_eventb);
unregister_trace_subsys_event(probe_subsys_event);
-int __init tp_sample_trace_init(void)
+static 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);
tracepoint_synchronize_unregister();
{
unregister_trace_subsys_event(probe_subsys_event);
tracepoint_synchronize_unregister();
-static int example_init(void)
+static int __init example_init(void)
{
printk(KERN_ALERT "example init\n");
pentry_example = proc_create("tracepoint-example", 0444, NULL,
{
printk(KERN_ALERT "example init\n");
pentry_example = proc_create("tracepoint-example", 0444, NULL,
-static void example_exit(void)
+static void __exit example_exit(void)
{
printk(KERN_ALERT "example exit\n");
remove_proc_entry("tracepoint-example", NULL);
{
printk(KERN_ALERT "example exit\n");
remove_proc_entry("tracepoint-example", NULL);