[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1267914654.849.81.camel@Joe-Laptop.home>
Date: Sat, 06 Mar 2010 14:30:54 -0800
From: Joe Perches <joe@...ches.com>
To: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Andrew Morton <akpm@...ux-foundation.org>,
Nick Andrew <nick@...k-andrew.net>,
linux-kernel@...r.kernel.org, Greg Kroah-Hartman <gregkh@...e.de>,
netdev@...r.kernel.org
Subject: Re: [RESEND PATCH 0/2] Make functions of dev_<level> macros,
recursive vsnprintf
On Sat, 2010-03-06 at 14:03 -0800, Linus Torvalds wrote:
> On Sat, 6 Mar 2010, Joe Perches wrote:
> > Is that an ack, a nack or a get the hell out?
> It's mostly an Ack. I think the concept is great. I'd love to have some
> way to limit recursion,
Maybe limit the %pV recursion depth to 1 with something like:
(in vsprintf.c: pointer() )
case 'V': {
char *rtn;
static int rcount++;
if (rcount > 1) { /* Don't recurse more than once */
rcount--;
break; /* Use print the pointer */
}
rtn = buf + vsnprintf(buf, end - buf,
((struct va_format *)ptr)->fmt,
*(((struct va_format *)ptr)->va));
rcount--;
return rtn;
}
> and I'd also love to see some actual numbers of
> how deep the vsnprintf stack frame is, but I don't see how to do the
> first, and I'm hoping the second isn't too horrible.
I believe it's the arguments, a long long, a couple of pointers,
and a struct printf_spec. Not too bad.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists