Subject: Re: [POWERPC] Fix off-by-one error in setting decrementer on Book E

From: Olof Johansson <[email-masked]>
Date: Sun, 28 Oct 2007 22:16:21 -0500

Hi Paul,

On Mon, Oct 29, 2007 at 01:57:17PM +1100, Paul Mackerras wrote:

> diff --git a/include/asm-powerpc/time.h b/include/asm-powerpc/time.h
> index f058955..eed64bd 100644
> --- a/include/asm-powerpc/time.h
> +++ b/include/asm-powerpc/time.h
> @@ -183,6 +183,7 @@ static inline void set_dec(int val)
>  #elif defined(CONFIG_8xx_CPU6)
>  	set_dec_cpu6(val);
>  #else
> +	--val;	/* classic decrementer interrupts when dec goes negative */
>  #ifdef CONFIG_PPC_ISERIES
>  	int cur_dec;

This will mix code and declarations, I think some toolchains complain
about that?

It doesn't look like cur_dec is really needed, the call can be inlined
directly where it's used.

-Olof