On 6/10/07, Gerrit Renker <gerrit@xxxxxxxxxxxxxx> wrote:
[DCCP]: Inline for time delta This provides a reusable time difference function which returns the difference in microseconds, as often used in the DCCP code. Signed-off-by: Gerrit Renker <gerrit@xxxxxxxxxxxxxx> --- net/dccp/dccp.h | 5 +++++ 1 file changed, 5 insertions(+) --- a/net/dccp/dccp.h +++ b/net/dccp/dccp.h @@ -421,6 +421,11 @@ static inline suseconds_t timeval_delta( return secs * USEC_PER_SEC + usecs; } +static inline s64 ktime_delta(ktime_t later, ktime_t earlier) +{ + return ktime_to_us(ktime_sub(later, earlier)); +} + static inline void timeval_add_usecs(struct timeval *tv, const suseconds_t usecs) {
Judging from patches I've seen rejected recently I'd say this should be shifted into the same place as ktime_sub is defined. Also rename to ktime_sub_us. I know that it sounds like I'm being a pain but I've seen a few like this rejected recently. Great to see patches moving ahead again. Ian -- Web: http://wand.net.nz/~iam4/ Blog: http://iansblog.jandi.co.nz WAND Network Research Group - To unsubscribe from this list: send the line "unsubscribe dccp" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html