Re: [PATCH] Provide an interface for getting the current tick length

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Paul Mackerras <[email protected]> wrote:
>
> +u64 current_tick_length(void)
>  +{
>  +	long time_adjust_step, delta_nsec;
>  +
>  +	if ((time_adjust_step = time_adjust) != 0 ) {

<mutters something about coding style>

>  +		/*
>  +		 * 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?

>  +	return ((u64) delta_nsec << (SHIFT_SCALE - 10)) + time_adj;
>  +}
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux