lkml.org 
[lkml]   [2008]   [Mar]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/1] Blackfin Watchdog Driver: split platform device/driver registering from actual watchdog device/driver registering so we can cleanly load/unload
On Wed, Mar 26, 2008 at 12:37 PM, Paul Mundt <lethal@linux-sh.org> wrote:
> On Wed, Mar 26, 2008 at 06:30:01PM -0700, Bryan Wu wrote:
> > +#define pr_devinit(fmt, args...) ({ static const __devinitdata char __fmt[] = fmt; printk(__fmt, ## args); })
> > #define pr_init(fmt, args...) ({ static const __initdata char __fmt[] = fmt; printk(__fmt, ## args); })
>
> WTF? You are trying to micro-optimize the string? And you have a printk
> that changes behaviour if you have hotplug enabled or not. That's so
> utterly bizarre that the rationale must be fascinating.

the rationale behind it seems fairly obvious to me. the strings are
placed into the respective init sections so they get released as
needed. it isnt a matter of tying it to hotplug as tying it to the
function: __init or __devinit.

> pr_xxx() also is a protected namespace that belongs in
> include/linux/kernel.h, though I can see why you opted to hide these in
> your driver rather than post them for general inclusion.

actually, it was already posted to lkml some time ago as an idea. the
idea stalled so i just use it in my drivers in the meantime. it's
certainly much cleaner than what was proposed by someone else
originally:
char __init foo[] = "moo";
...
printk(foo, ...)
...

> If you are hurting that badly for space, just turn off CONFIG_PRINTK and
> move on with life. This is just insane.

doing it this way seems pretty clean to me using existing section markings.
-mike


\
 
 \ /
  Last update: 2008-03-26 18:29    [W:0.743 / U:0.224 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site