From patchwork Thu Jun 23 03:30:02 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: dirk.brandewie@gmail.com X-Patchwork-Id: 907972 Received: from lists.sourceforge.net (lists.sourceforge.net [216.34.181.88]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p5N3UDsJ016719 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 23 Jun 2011 03:30:40 GMT Received: from localhost ([127.0.0.1] helo=sfs-ml-1.v29.ch3.sourceforge.com) by sfs-ml-1.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1QZacO-0007X9-9w; Thu, 23 Jun 2011 03:30:12 +0000 Received: from sog-mx-1.v43.ch3.sourceforge.com ([172.29.43.191] helo=mx.sourceforge.net) by sfs-ml-1.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1QZacN-0007X1-Hz for spi-devel-general@lists.sourceforge.net; Thu, 23 Jun 2011 03:30:11 +0000 Received-SPF: pass (sog-mx-1.v43.ch3.sourceforge.com: domain of gmail.com designates 209.85.210.47 as permitted sender) client-ip=209.85.210.47; envelope-from=dirk.brandewie@gmail.com; helo=mail-pz0-f47.google.com; Received: from mail-pz0-f47.google.com ([209.85.210.47]) by sog-mx-1.v43.ch3.sourceforge.com with esmtps (TLSv1:RC4-SHA:128) (Exim 4.76) id 1QZacM-0000PB-NT for spi-devel-general@lists.sourceforge.net; Thu, 23 Jun 2011 03:30:11 +0000 Received: by pzk36 with SMTP id 36so1217150pzk.34 for ; Wed, 22 Jun 2011 20:30:04 -0700 (PDT) Received: by 10.142.218.11 with SMTP id q11mr339460wfg.235.1308799804696; Wed, 22 Jun 2011 20:30:04 -0700 (PDT) Received: from [192.168.1.127] (static-50-43-44-248.bvtn.or.frontiernet.net [50.43.44.248]) by mx.google.com with ESMTPS id d15sm792689wfl.18.2011.06.22.20.30.03 (version=SSLv3 cipher=OTHER); Wed, 22 Jun 2011 20:30:03 -0700 (PDT) Message-ID: <4E02B33A.3060805@gmail.com> Date: Wed, 22 Jun 2011 20:30:02 -0700 From: Dirk Brandewie User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.17) Gecko/20110428 Fedora/3.1.10-1.fc13 Thunderbird/3.1.10 MIME-Version: 1.0 To: Feng Tang Subject: Re: [PATCH 09/11] spi-dw: Fix condition in spi_dw_{writer/reader} References: <1308794413-11069-1-git-send-email-dirk.brandewie@gmail.com> <1308794413-11069-10-git-send-email-dirk.brandewie@gmail.com> <20110623104506.3cfd55ce@feng-i7> <4E02AE6E.5010307@gmail.com> <20110623112552.6f22c3de@feng-i7> In-Reply-To: <20110623112552.6f22c3de@feng-i7> X-Spam-Score: -1.6 (-) X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. -1.5 SPF_CHECK_PASS SPF reports sender host as permitted sender for sender-domain 0.0 FREEMAIL_FROM Sender email is freemail (dirk.brandewie[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.0 RFC_ABUSE_POST Both abuse and postmaster missing on sender domain 0.0 AWL AWL: From: address is in the auto white-list X-Headers-End: 1QZacM-0000PB-NT Cc: "spi-devel-general@lists.sourceforge.net" , "linux-kernel@vger.kernel.org" X-BeenThere: spi-devel-general@lists.sourceforge.net X-Mailman-Version: 2.1.9 Precedence: list List-Id: Linux SPI core/device drivers discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: spi-devel-general-bounces@lists.sourceforge.net X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Thu, 23 Jun 2011 03:30:45 +0000 (UTC) This patch should have been: spi-dw: Fix condition in spi_dw_{writer/reader} From: Dirk Brandewie Fix the condition based on whether the current transfer has a tx/rx buffer. Signed-off-by: Dirk Brandewie --- drivers/spi/spi-dw.c | 10 +++++----- 1 files changed, 5 insertions(+), 5 deletions(-) ------------------------------------------------------------------------------ Simplify data backup and recovery for your virtual environment with vRanger. Installation's a snap, and flexible recovery options mean your data is safe, secure and there when you need it. Data protection magic? Nope - It's vRanger. Get your free trial download today. http://p.sf.net/sfu/quest-sfdev2dev diff --git a/drivers/spi/spi-dw.c b/drivers/spi/spi-dw.c index 96ae4a7..0a848bc 100644 --- a/drivers/spi/spi-dw.c +++ b/drivers/spi/spi-dw.c @@ -193,15 +193,15 @@ static void spi_dw_writer(struct spi_dw *dws) u16 txw = 0; while (max--) { - /* Set the tx word if the transfer's original "tx" is not null */ - if (dws->tx_end - dws->len) { + /* Set the tx word if the transfer's "tx" is not null */ + if (dws->tx) { if (dws->n_bytes == 1) txw = *(u8 *)(dws->tx); else txw = *(u16 *)(dws->tx); + dws->tx += dws->n_bytes; } dw_writew(dws, dr, txw); - dws->tx += dws->n_bytes; } } @@ -213,13 +213,13 @@ static void spi_dw_reader(struct spi_dw *dws) while (max--) { rxw = dw_readw(dws, dr); /* Care rx only if the transfer's original "rx" is not null */ - if (dws->rx_end - dws->len) { + if (dws->rx) { if (dws->n_bytes == 1) *(u8 *)(dws->rx) = rxw; else *(u16 *)(dws->rx) = rxw; + dws->rx += dws->n_bytes; } - dws->rx += dws->n_bytes; } }