On Wed, 6 Mar 2013, Feng Tang wrote: > On Wed, Mar 06, 2013 at 03:15:49PM +0100, Thomas Gleixner wrote: > > If the suspend time measured by the nonstop clocksource is 0.999 sec > > then we throw it away and then let the RTC code inject inaccurate > > sleep time? Brilliant design, really. > > Emm, I wrote the code with an assumption that the sleep itself and the > enter/exit processes will be longer than 1 second. > > I can initialize the ts_delta to (0, 0} and change the check condition > to > if (ts_delta.tv_sec || ts_delta.tv_nsec) >
To be honest, I hate this abuse of ts_delta as a condition. Use a separate condition variable to make clear what the hell that code is doing. This is not a fast path and I really prefer understandable code over magic microoptimizations for no value. Thanks, tglx -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/