Use init and exit marks.
[cascardo/kernel/samples/01.hello/.git] / hello.c
diff --git a/hello.c b/hello.c
index 772a1e3..327ee34 100644 (file)
--- a/hello.c
+++ b/hello.c
@@ -1,6 +1,12 @@
 /* Must be included by every module. */
 #include <linux/module.h>
 
+/* Author name comes here. */
+MODULE_AUTHOR("Thadeu Lima de Souza Cascardo <cascardo@holoscopio.com>");
+/* Tell a user what this modules does. */
+MODULE_DESCRIPTION("Prints a friendly message.");
+/* Which version is this? */
+MODULE_VERSION("1.4.0");
 /* Should be declared to not taint the kernel. */
 MODULE_LICENSE("GPL");
 
@@ -9,7 +15,7 @@ MODULE_LICENSE("GPL");
 #endif
 
 /* Our init function: returns 0 if successfull, an error code, otherwise. */
-static int hello_init(void)
+static int __init hello_init(void)
 {
        /* printk is just like printf, but without floating point support. */
        printk(KERN_ALERT "Hello, " SUBJECT "!\n");
@@ -17,7 +23,7 @@ static int hello_init(void)
 }
 
 /* Our exit function: static is good, so we do not pollute namespace. */
-static void hello_exit(void)
+static void __exit hello_exit(void)
 {
        /* KERN_ALERT is a string macro prepended to our message. */
        printk(KERN_ALERT "Goodbye, cruel " SUBJECT "!\n");