Re: [RFC PATCH 1/5] printk: implement pr_cont_t

From: Joe Perches
Date: Thu Aug 20 2020 - 12:03:35 EST


On Thu, 2020-08-20 at 07:44 +0000, David Laight wrote:
> From: Joe Perches
> > Sent: 20 August 2020 01:34
> >
> > On Thu, 2020-08-20 at 01:32 +0206, John Ogness wrote:
> > > Implement a new buffering mechanism for pr_cont messages.
> > >
> > > Old mechanism syntax:
> > >
> > > printk(KERN_INFO "text");
> > > printk(KERN_CONT " continued");
> > > printk(KERN_CONT "\n");
> > >
> > > New mechanism syntax:
> > >
> > > pr_cont_t c;
> > >
> > > pr_cont_begin(&c, KERN_INFO "text");
> >
> > bikeshed:
> >
> > I suggest:
> >
> > printk_begin(&printk_context, fmt, ...)
> > printk_continue(&printk_context, fmt, ...) (maybe printk_next())
> > printk_end(&printk_context, fmt, ...)
>
> I see some very long source lines looming ...

Macros make that pretty short.

pr_<level>_start
pr_next
pr_end

Doesn't seem too bad.