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

Re: Linking error



On Sun, Mar 04, 2007 at 09:16:37PM +0100, Rafał Bilski wrote:
> > [...]
> > 	delta_us = timespec_to_ns(&tv_delta) / 1000;
> > [...]
> Sorry. do_div() required.

No, the best solution seems to be to add a timespec_to_us() to
include/linux/time.h, something like (untested):

static inline s64 timespec_to_us(const struct timespec *ts)
{
        return ((s64) ts->tv_sec * USEC_PER_SEC) + ts->tv_nsec / 1000;
}

> Regards
> Rafał

cu
Adrian

-- 

       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed


--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ