lkml.org 
[lkml]   [2014]   [Jan]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] lib/vsprintf: add %pT[C012] format specifier
On Mon 2014-01-06 17:03:55, Joe Perches wrote:
> On Tue, 2014-01-07 at 01:16 +0100, Pavel Machek wrote:
> > > > > > diff --git a/lib/vsprintf.c b/lib/vsprintf.c
> > > > > []
> > > > > > @@ -1232,7 +1248,7 @@ char *pointer(const char *fmt, char *buf, char *end, void *ptr,
> > > > > > {
> > > > > > int default_width = 2 * sizeof(void *) + (spec.flags & SPECIAL ? 2 : 0);
> > > > > >
> > > > > > - if (!ptr && *fmt != 'K') {
> > > > > > + if (!ptr && *fmt != 'K' && *fmt != 'T') {
> > > > >
> > > > > I think this new 'T' comparison isn't necessary.
> > > >
> > > > This is needed for allowing comm_name() to accept NULL instead of current.
> > >
> > > Yeah, that's what I think isn't necessary.
> > >
> > > current is current_thread_info()->task.
> > >
> > > I think it's pretty lightweight in all arches and
> > > it'd be simpler/more intelligible to not use NULL.
> > >
> > > Andrew? Any opinion? Anyone else?
> >
> > Andrew was worried about all the "current" duplication, IIRC. It is in
> > the mail thread somewhere. And one condition in printk is price worth paying.
>
> Hi Pavel.
>
> I'm not nacking this, just stating my view.

And I believe Andrew clearly stated his view, on the very topic you
asked him on.

> I believe I showed how many uses of vsprintf w/ current
> there are. Passing NULL vs passing current as the %pT
> argument is I think a negligible overall size delta too.

One condition in if () is negligible, too, so passing NULL will still
be overall win. And that was the point of this patch series.

Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html


\
 
 \ /
  Last update: 2014-01-07 10:21    [W:0.099 / U:3.632 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site