lkml.org 
[lkml]   [2006]   [Feb]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] Provide an interface for getting the current tick length
Paul Mackerras <paulus@samba.org> wrote:
>
> Andrew Morton writes:
>
> > > + if ((time_adjust_step = time_adjust) != 0 ) {
> >
> > <mutters something about coding style>
>
> Seems perfectly plain to me, but if you don't like it I can change it.
>

[random space before right-paren?]

time_adjust_step = time_adjust;
if (time_adjust_step) {

would be more conventional. Some like the `!= 0' as well - personally I
find that a net distraction.

Ah, you copied-and-pasted from update_wall_time_one_tick().

Can we share that code?

> >
> > > + /*
> > > + * Limit the amount of the step to be in the range
> > > + * -tickadj .. +tickadj
> > > + */
> > > + time_adjust_step = min(time_adjust_step, (long)tickadj);
> > > + time_adjust_step = max(time_adjust_step, (long)-tickadj);
> > > + }
> > > + delta_nsec = tick_nsec + time_adjust_step * 1000;
> >
> > Is that going to overflow if sizeof(long) == 4?
>
> No. time_adjust_step is in microseconds and is restricted to the
> range -tickadj .. tickadj, and tickadj is between 1 and 10 (assuming
> HZ >= 50). tick_nsec is around 1e9 / HZ. There's no way delta_nsec
> could end up less than 0 or larger than around 20 million for any
> reasonable HZ value (i.e. >= 50).
>

ok...
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-02-16 03:13    [W:0.034 / U:1.060 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site