From patchwork Wed Jan 15 06:07:04 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Axel Lin X-Patchwork-Id: 3490211 Return-Path: X-Original-To: patchwork-linux-spi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 73C73C02DC for ; Wed, 15 Jan 2014 06:07:13 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3216220179 for ; Wed, 15 Jan 2014 06:07:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5CB6520125 for ; Wed, 15 Jan 2014 06:07:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750724AbaAOGHK (ORCPT ); Wed, 15 Jan 2014 01:07:10 -0500 Received: from mail-pd0-f175.google.com ([209.85.192.175]:54814 "EHLO mail-pd0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750723AbaAOGHJ (ORCPT ); Wed, 15 Jan 2014 01:07:09 -0500 Received: by mail-pd0-f175.google.com with SMTP id r10so670475pdi.20 for ; Tue, 14 Jan 2014 22:07:09 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:subject:from:to:cc:date:content-type :mime-version:content-transfer-encoding; bh=3XJf/KgsPCCmA1ljS43evwco1cyR4kf+BFVpDHzI4jo=; b=UtmqWgaH8JORMSNQmscZYS65Pg7QWSTWcJPi3ht5+uZp159RidzqWL/sTXellwIRP7 JGixOleRzUCyUXAp5+TBLqkV5/uZv/TeKsuDUhYhVQC5QNT7y3wQIgXG0yGPzEHM7B1d 2WNUNMTEDdcoZz1iuBrM8n3aAys5EHJOIoB3vXQ38Bs8U3er+w3wk6u87bwR1Hq83qRr mh7UuB7wMY7U9M5a5lhxokuKkCkAR90Rj10dF05nmcxkl0NP8KMewnhqptzjfLdxI/FF SACF4KplL3pyjC1ADJAqlAcYtVJKg64kNV6/LENBIf6/UNLrbjqhrO6Zgt2AqH7OTCxP UKMQ== X-Gm-Message-State: ALoCoQmSmvlz2zFHz7CBJq2/4Fz/xiIbIXSTVM1uQ7LIGox2s+jZi5NYAFQbCJKQcWR72KD4Xa8l X-Received: by 10.68.139.228 with SMTP id rb4mr410638pbb.15.1389766029611; Tue, 14 Jan 2014 22:07:09 -0800 (PST) Received: from [192.168.0.102] (218-164-139-120.dynamic.hinet.net. [218.164.139.120]) by mx.google.com with ESMTPSA id sx8sm7195351pab.5.2014.01.14.22.07.07 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 14 Jan 2014 22:07:09 -0800 (PST) Message-ID: <1389766024.7410.4.camel@phoenix> Subject: [PATCH] spi: tegra114: Use list_is_last() instead of open-coded From: Axel Lin To: Mark Brown Cc: Laxman Dewangan , linux-spi@vger.kernel.org Date: Wed, 15 Jan 2014 14:07:04 +0800 X-Mailer: Evolution 3.6.4-0ubuntu1 Mime-Version: 1.0 Sender: linux-spi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org X-Spam-Status: No, score=-7.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP For better readability, and then we can remove the comment for last transfer. Signed-off-by: Axel Lin --- drivers/spi/spi-tegra114.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/spi/spi-tegra114.c b/drivers/spi/spi-tegra114.c index 413c718..ead3ae8 100644 --- a/drivers/spi/spi-tegra114.c +++ b/drivers/spi/spi-tegra114.c @@ -853,8 +853,8 @@ complete_xfer: SPI_COMMAND1); tegra_spi_transfer_delay(xfer->delay_usecs); goto exit; - } else if (msg->transfers.prev == &xfer->transfer_list) { - /* This is the last transfer in message */ + } else if (list_is_last(&xfer->transfer_list, + &msg->transfers)) { if (xfer->cs_change) tspi->cs_control = spi; else {