[Cocci] printf vs. printk (was Re: Side-effect free printk?)

Joe Perches joe at perches.com
Fri Dec 5 16:24:54 CET 2014


On Fri, 2014-12-05 at 11:32 +0100, Pavel Machek wrote:
> Hi!
> 
> BTW... All the time I'm programming in kernel, I use printf(), and
> when hacking userspace, I use printk().
> 
> Nasty.
> 
> Given that printf() and printk() have exactly the same behaviour,
> could we allow printf() in kernel? Now... printk()s are usually
> removed before merging the driver, so code will not see much change,
> but it will certainly result in less 4-letter words while developing.

My preference would be to eventually eliminate printk
altogether but I don't see a real problem adding 
	#define printf printk
to include/linux/printk.h

but



More information about the Cocci mailing list