From: Gerrit Renker <gerrit@erg.abdn.ac.uk>
To: dccp@vger.kernel.org
Subject: Re: [PATCH 1/3]: Inline for time delta
Date: Mon, 11 Jun 2007 08:18:25 +0000 [thread overview]
Message-ID: <200706110918.25384@strip-the-willow> (raw)
In-Reply-To: <200706091932.15559@strip-the-willow>
Quoting Ian McDonald:
| > --- 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.
|
ktime_sub is defined in include/linux/ktime.h - the file only contains generic
definitions, everything is in nanoseconds, struct timeval, or struct timespec.
The other place is include/linux/skbuff.h, where net_timedelta() is defined.
This is probably due to the skb->tstamp field - as a utility function to be used
with skbs.
Neither place seems appropriate for above function, it is more specific than the
ones in ktime.h. I am at a loss where else if not the DCCP code, where it is
specifically used, to place it.
The name was chosen for consistency with timeval_delta(), which is the current
function for microsecond time differences in net/dccp/dccp.h.
next prev parent reply other threads:[~2007-06-11 8:18 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-06-09 18:32 [PATCH 1/3]: Inline for time delta Gerrit Renker
2007-06-10 5:55 ` Ian McDonald
2007-06-11 8:18 ` Gerrit Renker [this message]
2007-06-11 8:34 ` Ian McDonald
2007-06-16 14:04 ` Arnaldo Carvalho de Melo
2007-06-16 14:44 ` Gerrit Renker
2007-06-16 14:55 ` Arnaldo Carvalho de Melo
2007-06-16 15:00 ` Gerrit Renker
2007-06-16 15:01 ` Arnaldo Carvalho de Melo
2007-06-16 15:12 ` Arnaldo Carvalho de Melo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200706110918.25384@strip-the-willow \
--to=gerrit@erg.abdn.ac.uk \
--cc=dccp@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox