printk() Support Macros

--- a/include/linux/printk.h
+++ b/include/linux/printk.h
@@ -528,4 +528,8 @@ static inline void print_hex_dump_debug(const char *prefix_str, int prefix_type,
 }
 #endif

+#define PK()          PKF("", 0)
+#define PKS(str)      PKF("%s", str)
+#define PKF(fmt, ...) printk(KERN_EMERG "ATTIE: %s:%d %s(): " fmt, __FILE__, __LINE__, __FUNCTION__, __VA_ARGS__)
+
 #endif

Usage:

void fn(void) {
  /* just print a message with filename, line and function name */
  PK();

  /* print a message with a plain string only */
  PKS("%s", "hello");

  /* print a message with a format string and arguments */
  int var = 42;
  PKF("var: %d", var);
}