hello-3.c 536 B

123456789101112131415161718192021222324
  1. /*
  2. * hello-3.c - Illustrating the __init, __initdata and __exit macros.
  3. */
  4. #include <linux/init.h> /* Needed for the macros */
  5. #include <linux/module.h> /* Needed by all modules */
  6. #include <linux/printk.h> /* Needed for pr_info() */
  7. static int hello3_data __initdata = 3;
  8. static int __init hello_3_init(void)
  9. {
  10. pr_info("Hello, world %d\n", hello3_data);
  11. return 0;
  12. }
  13. static void __exit hello_3_exit(void)
  14. {
  15. pr_info("Goodbye, world 3\n");
  16. }
  17. module_init(hello_3_init);
  18. module_exit(hello_3_exit);
  19. MODULE_LICENSE("GPL");