I try to use the command printk.
All the examples I can find on the internet is by putting a string directly in the printk like this:
printk(KERN_INFO "Hello %s!", "World");
However, I tried to replace the "Hello %s!" using a buffer like this:
char buf[] = "Hello %s!";
printk(KERN_INFO buf, "WORLD");
It turns out that I get the error
error: expected ')' before 'buf'
What should we do to using a variable in printk and also use a log level KERN_INFO?