lkml.org 
[lkml]   [2008]   [Feb]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    From
    SubjectRe: [PATCH] Provide u64 version of jiffies_to_usecs() in
    Date
    On Tue Feb 19 13:25:25 2008, randy.dunlap@oracle.com wrote:
    >
    > > +u64 inline jiffies_64_to_usecs(const u64 j)
    > > +{
    > > + u64 tmp = j*HZ_TO_USEC_NUM + HZ_TO_USEC_DEN-1;
    > > + do_div(tmp, HZ_TO_USEC_DEN);
    >
    > do_div() is:
    > * The semantics of do_div() are:
    > *
    > * uint32_t do_div(uint64_t *n, uint32_t base)
    >
    > Maybe you want div64_64().
    >
    > > + return tmp;
    > > +}
    > > +EXPORT_SYMBOL(jiffies_64_to_usecs);
    > > +

    In include/asm-generic/div64.h, div64_64(uint64_t dividend, uint64_t divisor)
    just returns (dividend / divisor). Isn't this the same as what I had before
    in jiffies_64_to_usecs(), except that the arguments are of type u64?

    Jonathan


    \
     
     \ /
      Last update: 2008-02-19 23:01    [W:0.019 / U:2.068 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site