RE: [RFC PATCH 10/11] time sync: generic infrastructure to map between time stamps generated by a clock source and system time
From: Ohly, Patrick <hidden>
Date: 2008-11-20 07:09:23
Also in:
lkml
From: Ohly, Patrick <hidden>
Date: 2008-11-20 07:09:23
Also in:
lkml
Andrew wrote:
These patcehs add a lot of quite large inlined functions.
Right, I'll need to clean this up once it is clear which code is really going to be needed.
On Wed, 19 Nov 2008 13:08:47 +0100 Patrick Ohly [off-list ref] wrote:quoted
+static inline void clocksync_update(struct clocksync *sync, + u64 hwtstamp) +{ + s64 offset; + u64 average_time; + + if (hwtstamp && + (s64)(hwtstamp - sync->last_update) < NSEC_PER_SEC) + return; +
In this example, the check is going to avoid a function call when inlined in most of the cases. This was the motivation for making the function inline in the first place. The rest of it should be split of into a non-inline helper function. A "likely()" should be added, too.
The token '/**' is used exclusively to introduce kerneldoc-formatted comments. Please check the patches for comments which are incorrectly thus-tagged.
Sorry for that, will do. Old habits die hard.
Please cc linux-api@vger.kernel.org on patches which affect the kernel's userspace interfaces.
Okay. Bye, Patrick