Re: [RFC PATCH] vsprintf: Add %pv extension replacement for print_vma_addr

From: Joe Perches
Date: Mon Aug 17 2020 - 10:39:35 EST


On Mon, 2020-08-17 at 14:44 +0300, Andy Shevchenko wrote:
> On Fri, Aug 14, 2020 at 10:53:03AM -0700, Joe Perches wrote:
> > There is a print_vma_addr function used several places
> > that requires KERN_CONT use.
> >
> > Add a %pv mechanism to avoid the need for KERN_CONT.
>
> I like the idea, but I would accent the selling point to make code
> (in the user call sites) nicer.
[]
> > +#else
> > + buf = string_nocheck(buf, end, "CONFIG_MMU=n", default_str_spec);
> > +#endif
>
> Can we avoid this spammy message? Really it's quite long and fills valuable
> space in kernel buffer. I would rather print the hashed pointer as it's done
> for the rest of %pXXX.

Don't see why not. I believe it'd just use
buf = ptr_to_id(buf, end, ip, spec);
instead