[Top] [All Lists]

Re: [PATCH] casts in TLB macros

To: Andrew Isaacson <>
Subject: Re: [PATCH] casts in TLB macros
From: Ralf Baechle <>
Date: Wed, 17 Aug 2005 11:08:30 +0100
In-reply-to: <>
Original-recipient: rfc822;
References: <>
User-agent: Mutt/
On Tue, Aug 16, 2005 at 08:06:08PM -0700, Andrew Isaacson wrote:

> Fix three cases where macro arguments are not parenthesized, leading to
> incorrect operator precedence when called with an expression as the
> argument.  This causes incorrect evaluation of
>     write_c0_entrylo0(pte_val(*ptep++) >> 6)
> when pte_t is 64 bits - the pte value is cast to (unsigned int) first,
> then the shift is done, losing the top 32 bits.
> Also, this does not add an extra set of parentheses surrounding the
> (cast)(value) pair, as there's no danger of precedence problems to avoid
> given the high precedence of the cast operator and that this is the
> terminal macro in this macro trail.

Thanks, applied,


<Prev in Thread] Current Thread [Next in Thread>