From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966906AbdKQXMn (ORCPT ); Fri, 17 Nov 2017 18:12:43 -0500 Received: from mail-io0-f170.google.com ([209.85.223.170]:33976 "EHLO mail-io0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S966892AbdKQXMe (ORCPT ); Fri, 17 Nov 2017 18:12:34 -0500 X-Google-Smtp-Source: AGs4zMYNNdIJVmdB9lEpvTA1w1+FM36RfXjtSqyGgc2Opi30BhQanT6YRIvsE1bMUVRAb/hGk20KeDzLI9TA90Rbx+k= MIME-Version: 1.0 In-Reply-To: <20171117180034.30413b64@gandalf.local.home> References: <20171115181531.322572387@linutronix.de> <20171115182657.463124645@linutronix.de> <20171117180034.30413b64@gandalf.local.home> From: Linus Torvalds Date: Fri, 17 Nov 2017 15:12:33 -0800 X-Google-Sender-Auth: Y1V71WTutIFCFRcKrH41zE6ihFc Message-ID: Subject: Re: [RFC patch 4/7] timekeeping: Add NMI safe accessor to mono/boot/real clocks To: Steven Rostedt Cc: Thomas Gleixner , LKML , Prarit Bhargava , Mark Salyzyn , Petr Mladek , Ingo Molnar , "H. Peter Anvin" , Peter Zijlstra , Andrew Morton , Sergey Senozhatsky , Joe Perches Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Nov 17, 2017 at 3:00 PM, Steven Rostedt 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