From patchwork Thu Jun 23 02:00:11 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: 907822 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 p5N216fp002528 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 23 Jun 2011 02:01:27 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 1QZZE8-0003nB-Cn; Thu, 23 Jun 2011 02:01:04 +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 1QZZE7-0003n6-4z for spi-devel-general@lists.sourceforge.net; Thu, 23 Jun 2011 02:01:03 +0000 Received-SPF: pass (sog-mx-1.v43.ch3.sourceforge.com: domain of gmail.com designates 74.125.83.175 as permitted sender) client-ip=74.125.83.175; envelope-from=dirk.brandewie@gmail.com; helo=mail-pv0-f175.google.com; Received: from mail-pv0-f175.google.com ([74.125.83.175]) by sog-mx-1.v43.ch3.sourceforge.com with esmtps (TLSv1:RC4-SHA:128) (Exim 4.76) id 1QZZE4-0005hE-V6 for spi-devel-general@lists.sourceforge.net; Thu, 23 Jun 2011 02:01:03 +0000 Received: by pvf24 with SMTP id 24so1239184pvf.34 for ; Wed, 22 Jun 2011 19:00:55 -0700 (PDT) Received: by 10.143.39.17 with SMTP id r17mr320017wfj.113.1308794455063; Wed, 22 Jun 2011 19:00:55 -0700 (PDT) Received: from localhost.localdomain (static-50-43-44-248.bvtn.or.frontiernet.net [50.43.44.248]) by mx.google.com with ESMTPS id u6sm846417pbh.80.2011.06.22.19.00.54 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 22 Jun 2011 19:00:54 -0700 (PDT) From: dirk.brandewie@gmail.com To: linux-kernel@vger.kernel.org, spi-devel-general@lists.sourceforge.net Subject: [PATCH 09/11] spi-dw: Fix condition in spi_dw_{writer/reader} Date: Wed, 22 Jun 2011 19:00:11 -0700 Message-Id: <1308794413-11069-10-git-send-email-dirk.brandewie@gmail.com> X-Mailer: git-send-email 1.7.3.4 In-Reply-To: <1308794413-11069-1-git-send-email-dirk.brandewie@gmail.com> References: <1308794413-11069-1-git-send-email-dirk.brandewie@gmail.com> 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 T_TO_NO_BRKTS_FREEMAIL T_TO_NO_BRKTS_FREEMAIL -0.0 AWL AWL: From: address is in the auto white-list X-Headers-End: 1QZZE4-0005hE-V6 Cc: Dirk Brandewie 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: , MIME-Version: 1.0 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 02:01:27 +0000 (UTC) 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 | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/spi/spi-dw.c b/drivers/spi/spi-dw.c index cc38aa0..35b952b 100644 --- a/drivers/spi/spi-dw.c +++ b/drivers/spi/spi-dw.c @@ -193,8 +193,8 @@ 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 @@ -213,7 +213,7 @@ 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