Re: [PATCH 1/3]: Inline for time delta

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.
-
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

[Index of Archives]     [Linux Kernel]     [IETF DCCP]     [Linux Networking]     [Git]     [Security]     [Linux Assembly]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux