From 3559c37d96b467dbd5abd5e9e6695e2fccb7958f Mon Sep 17 00:00:00 2001 From: Thadeu Lima de Souza Cascardo Date: Sat, 5 Dec 2009 22:39:24 -0200 Subject: [PATCH] Use a macro for the configured message subject. --- hello.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/hello.c b/hello.c index 25c722d..772a1e3 100644 --- a/hello.c +++ b/hello.c @@ -4,11 +4,15 @@ /* Should be declared to not taint the kernel. */ MODULE_LICENSE("GPL"); +#ifndef SUBJECT +#define SUBJECT "world" +#endif + /* Our init function: returns 0 if successfull, an error code, otherwise. */ static int hello_init(void) { /* printk is just like printf, but without floating point support. */ - printk(KERN_ALERT "Hello, world!\n"); + printk(KERN_ALERT "Hello, " SUBJECT "!\n"); return 0; } @@ -16,7 +20,7 @@ static int hello_init(void) static void hello_exit(void) { /* KERN_ALERT is a string macro prepended to our message. */ - printk(KERN_ALERT "Goodbye, cruel world!\n"); + printk(KERN_ALERT "Goodbye, cruel " SUBJECT "!\n"); } /* Here, we declare our module init and exit functions. */ -- 2.20.1