Re: [U-Boot] [PATCH] time: fix usec_to_tick()

2013-12-09 Thread Rob Herring
On Thu, Dec 5, 2013 at 1:08 PM, Stephen Warren wrote: > From: Stephen Warren > > Commit 8dfafdde88eb ("Introduce common timer functions") created a > common definition of usec_to_tick() which had a couple problems: > > static unsigned long long usec_to_tick(unsigned long usec) > { >uint64

[U-Boot] [PATCH] time: fix usec_to_tick()

2013-12-05 Thread Stephen Warren
From: Stephen Warren Commit 8dfafdde88eb ("Introduce common timer functions") created a common definition of usec_to_tick() which had a couple problems: static unsigned long long usec_to_tick(unsigned long usec) { uint64_t tick = usec * get_tbclk(); That likely overflows. usec *=