lkml.org 
[lkml]   [2019]   [Feb]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v6 5/9] vsprintf: Factor out %pV handler as va_format()
On Tue, 12 Feb 2019 09:58:25 -0800
Joe Perches <joe@perches.com> wrote:

> On Tue, 2019-02-12 at 14:00 +0100, Petr Mladek wrote:
> > On Fri 2019-02-08 09:11:17, Joe Perches wrote:
> > > On Fri, 2019-02-08 at 16:23 +0100, Petr Mladek wrote:
> > > > Move the code from the long pointer() function. We are going to improve
> > > > error handling that will make it more complicated.
> > > >
> > > > This patch does not change the existing behavior.
> > >
> > > But doesn't this increase stack use?
> > > %pV is recursive and increasing the stack is undesired
> > > for this use.
> >
> > %pV handler is stack sensitive because the entire vsnprintf()
> > machinery is called recursively. This one extra call does
> > not make it much worse.
>
> That's an argument?.
>
> Refactoring is good, but you need to add
> __always_inline here.
>

If a single function call causes this to overflow the stack, then the
code is already broken to begin with.

-- Steve

\
 
 \ /
  Last update: 2019-02-12 20:48    [W:0.102 / U:0.040 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site