Re: small patch for setting RTC on Linux/intel (fwd)

Urs Thuermann (urs@isnogud.escape.de)
Sat, 29 Nov 1997 11:55:52 +0100


> 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