lkml.org 
[lkml]   [2004]   [May]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
SubjectRe: [PATCH] fix dev_printk to work even in the absence of am attached driver
From
Date
On Thu, 2004-04-22 at 17:07, Greg KH wrote: 
> 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 :)

OK, I can't find an elegant way of making it global, so I think the best
thing to do is just leave it blank for no driver (gcc can optimise that
case).

James

===== include/linux/device.h 1.117 vs edited =====
--- 1.117/include/linux/device.h Mon Apr 12 12:54:25 2004
+++ edited/include/linux/device.h Tue May 11 08:58:44 2004
@@ -400,7 +400,7 @@

/* 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 : "" , (dev)->bus_id , ## arg)

#ifdef DEBUG
#define dev_dbg(dev, format, arg...) \
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 14:03    [W:0.089 / U:0.532 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site