[prev in list] [next in list] [prev in thread] [next in thread] 

List:       linux-kernel
Subject:    Re: small patch for setting RTC on Linux/intel (fwd)
From:       Urs Thuermann <urs () isnogud ! escape ! de>
Date:       1997-11-29 11:55:52
[Download RAW message or body]

> I think "lowerbound <= usec < upper_bound" would have been enough, 
> but:

That's what my first patch looked like.  Then ...

> If you remember that tick can be adjusted (maybe to 9999), you can 
> have the additional problem tha tthe interval is still too small. 
> What about replacing "(tick / 2)" with "((tick + 1) / 2)". (gcc 
> shouldn't care about ">> 1" or "/ 2" if the number is unsigned...)

... I also noticed the case of odd values for tick.  I also thought
about (tick+1)/2 which is somewhat cleaner, since it doesn't make the
intervall one larger than neccessary in case of even tick.  But in the
end I found lbound <= usec <= ubound more symmetrical and prefered
that.  Doesn't matter that much, however.

But one should consider (tick + tickadj)/2 instead of tick/2, as
otherwise it could still happen that the RTC is not set (or was it
time_adj instead of tickadj?)


urs

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic