From patchwork Wed Feb 12 14:13:27 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Axel Lin X-Patchwork-Id: 3638341 X-Patchwork-Delegate: broonie@sirena.org.uk Return-Path: X-Original-To: patchwork-linux-spi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 875A89F334 for ; Wed, 12 Feb 2014 14:13:53 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id AD59A20158 for ; Wed, 12 Feb 2014 14:13:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id DEFF620165 for ; Wed, 12 Feb 2014 14:13:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751337AbaBLONv (ORCPT ); Wed, 12 Feb 2014 09:13:51 -0500 Received: from mail-pa0-f42.google.com ([209.85.220.42]:49787 "EHLO mail-pa0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751065AbaBLONv (ORCPT ); Wed, 12 Feb 2014 09:13:51 -0500 Received: by mail-pa0-f42.google.com with SMTP id kl14so9258640pab.15 for ; Wed, 12 Feb 2014 06:13:50 -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=5ki2wf1PuiPObXsh96j8pEtlGL4UJH2zn4/fHsbCkrk=; b=A+Ko0o/6Xhw24fbRMCTRJ1JePH6+2UmY5QlCoOkw126CgJw9khWP29jKYE2fsMFRqm trEmZ4Zse0h5J21K0QLJQ9GNty5MT9mQt9z2ld1XMh1b1SYIjRHTmgDHXuOIN24BfWf3 GtSWfHnFNQmOpeGeklPTaCAA4cLnHWLs/QVxTHQhCa5RfR5qmlDckSPcIhfqCRLbL7mC TzkR59gQVuR6IaozQiZqu3rcJZ12cTREWuiNrKYpO9yGc3h3FjRihLBfiSz3zdRxguo9 pvdwaRi8Pa65i7VvhxRrJSsoYfSuke5oOx7QHJP6r9YWmd4ze3UDkZDcbwIEhlA91wq2 JuoA== X-Gm-Message-State: ALoCoQn4ATKnbTb4jTIeyDRnLTSqHUeeUx8PWeuIbBbjqSN7Pj4PZPSegN0owggTM8FdzQ5MhPTU X-Received: by 10.68.43.2 with SMTP id s2mr51332522pbl.60.1392214430580; Wed, 12 Feb 2014 06:13:50 -0800 (PST) Received: from [10.145.55.56] ([60.245.65.194]) by mx.google.com with ESMTPSA id yd4sm64021146pbc.13.2014.02.12.06.13.30 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 12 Feb 2014 06:13:49 -0800 (PST) Message-ID: <1392214407.11101.6.camel@phoenix> Subject: [PATCH] spi: Use list_last_entry at appropriate places From: Axel Lin To: Mark Brown Cc: Feng Tang , Linus Walleij , Haojian Zhuang , linux-spi@vger.kernel.org Date: Wed, 12 Feb 2014 22:13:27 +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.6 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 Signed-off-by: Axel Lin --- drivers/spi/spi-dw.c | 3 +-- drivers/spi/spi-pl022.c | 5 ++--- drivers/spi/spi-pxa2xx.c | 3 +-- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/drivers/spi/spi-dw.c b/drivers/spi/spi-dw.c index bf98d63..390da9b 100644 --- a/drivers/spi/spi-dw.c +++ b/drivers/spi/spi-dw.c @@ -276,8 +276,7 @@ static void giveback(struct dw_spi *dws) queue_work(dws->workqueue, &dws->pump_messages); spin_unlock_irqrestore(&dws->lock, flags); - last_transfer = list_entry(msg->transfers.prev, - struct spi_transfer, + last_transfer = list_last_entry(&msg->transfers, struct spi_transfer, transfer_list); if (!last_transfer->cs_change && dws->cs_control) diff --git a/drivers/spi/spi-pl022.c b/drivers/spi/spi-pl022.c index 74a0729..3e7c377 100644 --- a/drivers/spi/spi-pl022.c +++ b/drivers/spi/spi-pl022.c @@ -459,9 +459,8 @@ static void giveback(struct pl022 *pl022) struct spi_transfer *last_transfer; pl022->next_msg_cs_active = false; - last_transfer = list_entry(pl022->cur_msg->transfers.prev, - struct spi_transfer, - transfer_list); + last_transfer = list_last_entry(&pl022->cur_msg->transfers, + struct spi_transfer, transfer_list); /* Delay if requested before any change in chip select */ if (last_transfer->delay_usecs) diff --git a/drivers/spi/spi-pxa2xx.c b/drivers/spi/spi-pxa2xx.c index c702fc5..41185d0 100644 --- a/drivers/spi/spi-pxa2xx.c +++ b/drivers/spi/spi-pxa2xx.c @@ -362,8 +362,7 @@ static void giveback(struct driver_data *drv_data) drv_data->cur_msg = NULL; drv_data->cur_transfer = NULL; - last_transfer = list_entry(msg->transfers.prev, - struct spi_transfer, + last_transfer = list_last_entry(&msg->transfers, struct spi_transfer, transfer_list); /* Delay if requested before any change in chip select */