[U-Boot] [PATCH (repost)] Nomadik: fix reset_timer()

Wolfgang Denk wd at denx.de
Tue Nov 3 16:59:24 CET 2009


Dear Alessandro Rubini,

In message <20091103152354.GA12451 at mail.gnudd.com> you wrote:
> > Um... why is READ_TIMER doing such a stupid thing as negating values?
> 
> Because the counter counts down. I could have returns "0 - value" or
> "~value".  Since I chose the latter initially, this fix keeps the same
> approach.  I can't return the value I read, since it goes backwards.

Well, to me READ_TIMER() sounds like a function/macro to read some
value from some timer; if that timer counts doen, then successive
calls to that macro/function would return decreasing values. Counting
up or down is a property of the specific timer and should be handled
elsewhere; such policy does IMHO not belong into some accessor
function.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Brain: an apparatus with which we think we think.    - Ambrose Bierce


More information about the U-Boot mailing list