Re: [PATCH] fix dev_printk to work even in the absence of am attached driver

From: Greg KH
Date: Thu Apr 22 2004 - 17:16:29 EST

On Mon, Apr 19, 2004 at 03:39:57PM -0500, James Bottomley wrote:
> /* debugging and troubleshooting/diagnostic helpers. */
> #define dev_printk(level, dev, format, arg...) \
> - printk(level "%s %s: " format , (dev)->driver->name , (dev)->bus_id , ## arg)
> + printk(level "%s %s: " format , (dev)->driver ? (dev)->driver->name : "(unbound)", (dev)->bus_id , ## arg)

But doesn't this cause the string "(unbound)" to be created for every
dev_printk() call in the code? I don't think gcc can optimize that very
well. How about making a global string just for that, otherwise the
size police will come after me for adding such a patch :)


greg k-h
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at