[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CA+55aFzFnQ9n=kfLCnq_mmDD3aqb+Uy_BHy9234UxCYTPPqBig@mail.gmail.com>
Date: Fri, 17 Nov 2017 15:12:33 -0800
From: Linus Torvalds <torvalds@...ux-foundation.org>
To: Steven Rostedt <rostedt@...dmis.org>
Cc: Thomas Gleixner <tglx@...utronix.de>,
LKML <linux-kernel@...r.kernel.org>,
Prarit Bhargava <prarit@...hat.com>,
Mark Salyzyn <salyzyn@...roid.com>,
Petr Mladek <pmladek@...e.com>, Ingo Molnar <mingo@...nel.org>,
"H. Peter Anvin" <hpa@...or.com>,
Peter Zijlstra <peterz@...radead.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Sergey Senozhatsky <sergey.senozhatsky@...il.com>,
Joe Perches <joe@...ches.com>
Subject: Re: [RFC patch 4/7] timekeeping: Add NMI safe accessor to
mono/boot/real clocks
On Fri, Nov 17, 2017 at 3:00 PM, Steven Rostedt <rostedt@...dmis.org> wrote:
>
> Could you indent this better. It looks like timekeeping_delta_to_ns()
> takes 4 arguments, when it really only takes two.
Actually, even better would be to simply not have that ugly three-line
expression from hell.
Maybe it could even be a helper inline function, somethin glike
static inline u64 tk_delta_ns(struct tk_read_base *tkr)
{
u64 cycle = tk_clock_read(tkr);
u64 delta= clocksource_delta(cycle, tkr->cycle_last, tkr->mask);
return timekeeping_delta_to_ns(tkr, cycle);
}
and that whole thing would just become
now += tk_delta_ns(tkr);
which looks a whole lot more legible. And shouldn't generate any worse code.
(I might have screwed up something, I wrote that in the email client,
maybe I got something wrong.
And my name choice is probably garbage. But you get the idea.
Linus
Powered by blists - more mailing lists