[PATCH] Adapt spi_mpc83xx SPI driver for 832x

Joakim Tjernlund joakim.tjernlund at transmode.se
Wed Dec 13 20:59:49 EST 2006


> -----Original Message-----
> From: Vitaly Wool [mailto:vitalywool at gmail.com] 
> Sent: 13 December 2006 10:44
> To: Joakim Tjernlund
> Cc: linuxppc-dev at ozlabs.org
> Subject: Re: [PATCH] Adapt spi_mpc83xx SPI driver for 832x
> 
> On 12/13/06, Joakim Tjernlund <joakim.tjernlund at transmode.se> wrote:
> 
> 	The MPC 832x has a different SPI controller i/f, probably due to
> 	its QUICC engine support. This patch adapts the 
> spi_mpx83xx driver to
> 	be usable on QE based 83xx cpus.
> 	
> 
> 
> First, I'm pretty much against sending such patches to arch 
> lists and not to subsystem lists.

OK, you don't want it on this list at all then?
 
> 
> @@ -99,31 +105,39 @@ static inline u32 mpc83xx_spi_read_reg(_
>         return in_be32(reg);
>  }
> 
> Then,  this 
> +       *rx++ = (type)(data >> shift);                        
>             \
> and this 
> +       data = *tx++ << shift;                                  \
> 
> pieces of code are potentially dangerous (what if 'shift' is 
> something like 'x & 0xf3 << 4' ?)

>From this I think you want to change it to:
+       *rx++ = (type)(data >> (shift));

and 
+       data = *tx++ << (shift);

Will do and resubmit to spi-devel-general at lists.sourceforge.net
as requested by you and Leo.

 Jocke



More information about the Linuxppc-dev mailing list