Re: [PATCH v2 07/28] lib/printbuf: Unit specifiers

From: Kent Overstreet
Date: Fri May 20 2022 - 00:37:09 EST


On Fri, May 20, 2022 at 12:16:41AM +0300, Andy Shevchenko wrote:
> On Thu, May 19, 2022 at 04:26:26PM -0400, Kent Overstreet wrote:
> > On Thu, May 19, 2022 at 11:21:41PM +0300, Andy Shevchenko wrote:
> > > On Thu, May 19, 2022 at 01:24:00PM -0400, Kent Overstreet wrote:
>
> ...
>
> > > > + if (v < 0)
> > > > + pr_char(buf, '-');
> > > > + pr_human_readable_u64(buf, abs(v));
> > >
> > > Wouldn't -v work?
> >
> > This is a bit terser
>
> Have you checked assembly? Basically the question here is does the compiler see
> the same conditional and avoid duplicating it?

No. I check the assembly for code where it matters - for this, I'm going to
write it the way I find it most readable.

> I run `make W=1`, but I think the kernel doc validator is run anyway.

Got it, and fixed the doc warnings.