From: Ingo Molnar Date: Thu, 5 Feb 2009 12:45:43 +0000 (+0100) Subject: printk: introduce printk_once() X-Git-Tag: v2.6.30-rc1~208^2~8 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f036be96dd9ce442ffb9ab33e3c165f5178815c0;p=pandora-kernel.git printk: introduce printk_once() This pattern shows up frequently in the kernel: static int once = 1; ... if (once) { once = 0; printk(KERN_ERR "message\n"); } ... So add a printk_once() helper macro that reduces this to a single line of: printk_once(KERN_ERR "message\n"); It works analogously to WARN_ONCE() & friends. (We use a macro not an inline because vararg expansion in inlines looks awkward and the macro is simple enough.) Signed-off-by: Ingo Molnar --- Reading git-diff-tree failed