From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ug-out-1314.google.com (ug-out-1314.google.com [66.249.92.175]) by ozlabs.org (Postfix) with ESMTP id 5881067C13 for ; Wed, 13 Dec 2006 20:44:24 +1100 (EST) Received: by ug-out-1314.google.com with SMTP id k3so114913ugf for ; Wed, 13 Dec 2006 01:44:20 -0800 (PST) Message-ID: Date: Wed, 13 Dec 2006 12:44:19 +0300 From: "Vitaly Wool" To: joakim.tjernlund@transmode.se Subject: Re: [PATCH] Adapt spi_mpc83xx SPI driver for 832x In-Reply-To: <1166001747.30422.43.camel@gentoo-jocke.transmode.se> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_134255_13775682.1166003059976" References: <1166001747.30422.43.camel@gentoo-jocke.transmode.se> Cc: linuxppc-dev@ozlabs.org List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , ------=_Part_134255_13775682.1166003059976 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline On 12/13/06, Joakim Tjernlund 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. @@ -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' ?) Vitaly ------=_Part_134255_13775682.1166003059976 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline On 12/13/06, Joakim Tjernlund <joakim.tjernlund@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.

@@ -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' ?)

Vitaly
------=_Part_134255_13775682.1166003059976--