On Wednesday, June 29, 2011 00:51:50 Graeme Russ wrote: > On Wed, Jun 29, 2011 at 2:45 PM, Simon Glass wrote: > > On Tue, Jun 28, 2011 at 4:41 AM, Graeme Russ wrote: > >> --- a/arch/blackfin/cpu/jtag-console.c > >> +++ b/arch/blackfin/cpu/jtag-console.c > >> > >> - ulong timeout = get_timer(0) + CONFIG_JTAG_CONSOLE_TIMEOUT; > >> + ulong start = time_now_ms(); > >> while (bfin_read_DBGSTAT() & 0x1) { > >> if (overflowed) > >> return overflowed; > >> - if (timeout < get_timer(0)) > >> + if (time_since_ms(start) >= CONFIG_JTAG_CONSOLE_TIMEOUT) > >> overflowed = true; > >> } > > > > Here I think I have found a use of future time. It is true what they > > say (or should say) that there is every kind of timeout in U-Boot. > > I personally think that this particular use-case of the timer API is ugly, > but I was not out to change any symantics, just do a blind translation > from the old API to the new API > > Hopefully, this will highlight a few dodgy use cases (which I am willing > to apply fixes for as and when others suggest them)
i wrote this long before i really understood the timer api. after all, even now, there is 0 documentation on the API in the u-boot tree. should be easy to change the two lines to use the API as designed. -mike
signature.asc
Description: This is a digitally signed message part.
_______________________________________________ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot