Re: [PATCH] casts in TLB macros

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

 



On Wed, Aug 17, 2005 at 11:08:30AM +0100, Ralf Baechle wrote:
> 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,

Thank *you* for being smarter than me about the parenthesis...

(The patch I sent out was lacking the outer parens, and I used the
following plan for world domination:
1. notice problem, cut patch
2. go to dinner
3. test compile something unrelated by accident
4. send patch to mailing list
5. profit!)

-andy



[Index of Archives]     [Linux MIPS Home]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Linux]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux