From patchwork Wed Jan 15 05:22:17 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Axel Lin X-Patchwork-Id: 3490041 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 B32CC9F169 for ; Wed, 15 Jan 2014 05:22:26 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E337220212 for ; Wed, 15 Jan 2014 05:22:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 308CF2020F for ; Wed, 15 Jan 2014 05:22:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751436AbaAOFWY (ORCPT ); Wed, 15 Jan 2014 00:22:24 -0500 Received: from mail-pb0-f54.google.com ([209.85.160.54]:38918 "EHLO mail-pb0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751324AbaAOFWY (ORCPT ); Wed, 15 Jan 2014 00:22:24 -0500 Received: by mail-pb0-f54.google.com with SMTP id un15so631837pbc.41 for ; Tue, 14 Jan 2014 21:22:23 -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=rHlw5JpV6b5aOSKKHDvQsX+zjlxsChqx/Z5q375/TQA=; b=HZZ5G4rBiiMOPBxL59SL1ZZc/Daua/s7Ng89LgGRpmaGZL1e5UnPp8UiLSaEOfobab DscfIC7ZbhXx1aaAZB9wNn+9n0GdR4GF16ClgTPQ2XE+er4EurdViTel/5DRZNIY/Esw f+/nS1vvuO4dtvr9YbMl5v60JCbCEoJcKp6hgESfaD9SpxAHwDh32t3Pd63Owg7PqIG3 9+vEAwLUeW2bkyfZCpZGFhNfzyv/0PLB4hWmUMn1CVBYVfhZtDhWxz8nbOaaaQMHmxZK fOS7tQ5NvJ9XoKrgQCnZAcuBA+vc7c4nqqjdIfAPQJV1iBuNzFidHBv43ozzmT0nNnK9 A+gQ== X-Gm-Message-State: ALoCoQkQw4EX0vTeUgyfw5ODF/hrf/9sTpynnB+NuPB4hFsQ6Fxa+Tr5sgQa2FFxEfeE1olkqB4L X-Received: by 10.68.163.228 with SMTP id yl4mr152123pbb.91.1389763343626; Tue, 14 Jan 2014 21:22:23 -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 nv7sm5178261pbc.31.2014.01.14.21.22.21 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 14 Jan 2014 21:22:22 -0800 (PST) Message-ID: <1389763337.7410.1.camel@phoenix> Subject: [PATCH] spi: octeon: Use list_is_last() instead of open-coded From: Axel Lin To: Mark Brown Cc: David Daney , John Crispin , linux-spi@vger.kernel.org Date: Wed, 15 Jan 2014 13:22:17 +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 Signed-off-by: Axel Lin --- drivers/spi/spi-octeon.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/spi/spi-octeon.c b/drivers/spi/spi-octeon.c index 67249a4..862ef30 100644 --- a/drivers/spi/spi-octeon.c +++ b/drivers/spi/spi-octeon.c @@ -179,7 +179,8 @@ static int octeon_spi_transfer_one_message(struct spi_master *master, } list_for_each_entry(xfer, &msg->transfers, transfer_list) { - bool last_xfer = &xfer->transfer_list == msg->transfers.prev; + bool last_xfer = list_is_last(&xfer->transfer_list, + &msg->transfers); int r = octeon_spi_do_transfer(p, msg, xfer, last_xfer); if (r < 0) { status = r;