From patchwork Wed Feb 5 09:47:59 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Axel Lin X-Patchwork-Id: 3585381 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 3ECE99F2E9 for ; Wed, 5 Feb 2014 09:48:10 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5E4B5201CD for ; Wed, 5 Feb 2014 09:48:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9AE38201C7 for ; Wed, 5 Feb 2014 09:48:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751848AbaBEJsI (ORCPT ); Wed, 5 Feb 2014 04:48:08 -0500 Received: from mail-pd0-f174.google.com ([209.85.192.174]:41660 "EHLO mail-pd0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751837AbaBEJsF (ORCPT ); Wed, 5 Feb 2014 04:48:05 -0500 Received: by mail-pd0-f174.google.com with SMTP id z10so145679pdj.33 for ; Wed, 05 Feb 2014 01:48:04 -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=IGrM/q84bionUDyHeSO7PmcV1s/Fj9V2ZG3QNgunEkU=; b=WyVg5qD3c7W9hXhC8UR3AH+NnQJbo87OJ5AxkP+ePEiTdt6bfBLVo1OC489RRUjqD6 +5wafYLt8lPxm6/K4fc3LTlj/b+MocZMn1RMd21aC3261cWewCxI9lViburMVPwRlnke UmMR6RQI9QP0CLZuSuCMWrhi3z0pQf5UHNJD4hkFuQlV0IZYdqW0QkHy878hDot4jvYN rDcZrM6jmiDczbCrjUyre7oHbkK+DZ6dmIVHHJcyDtRT4/2mDI3orGOomc+6y4dXC+hR qelNKOdna0KbKc4sL+enWFYiEziqPpYIDy1EKmIJ9+31AnJBvjEqlUTt/14Y79d65zUY Zbfw== X-Gm-Message-State: ALoCoQl4FsJJMNRQSH4c8uRkz6oqQJesRrU+wzCz+3xtBqOkrYWWKIwJPztZ35moZKlYF3CseSvI X-Received: by 10.66.121.131 with SMTP id lk3mr547312pab.61.1391593684473; Wed, 05 Feb 2014 01:48:04 -0800 (PST) Received: from [192.168.0.102] (218-164-132-53.dynamic.hinet.net. [218.164.132.53]) by mx.google.com with ESMTPSA id vn10sm74745970pbc.21.2014.02.05.01.48.02 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 05 Feb 2014 01:48:03 -0800 (PST) Message-ID: <1391593679.1420.1.camel@phoenix> Subject: [PATCH] spi: mxs: Use list_for_each_entry to iterate over transfer list From: Axel Lin To: Mark Brown Cc: Marek Vasut , linux-spi@vger.kernel.org Date: Wed, 05 Feb 2014 17:47:59 +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.4 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 We don't modify the list entry while iterating the transfer list. So use list_for_each_entry instead of list_for_each_entry_safe. Signed-off-by: Axel Lin Acked-by: Marek Vasut --- drivers/spi/spi-mxs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/spi/spi-mxs.c b/drivers/spi/spi-mxs.c index 17bb9a9..4208f24 100644 --- a/drivers/spi/spi-mxs.c +++ b/drivers/spi/spi-mxs.c @@ -370,7 +370,7 @@ static int mxs_spi_transfer_one(struct spi_master *master, { struct mxs_spi *spi = spi_master_get_devdata(master); struct mxs_ssp *ssp = &spi->ssp; - struct spi_transfer *t, *tmp_t; + struct spi_transfer *t; unsigned int flag; int status = 0; @@ -380,7 +380,7 @@ static int mxs_spi_transfer_one(struct spi_master *master, writel(mxs_spi_cs_to_reg(m->spi->chip_select), ssp->base + HW_SSP_CTRL0 + STMP_OFFSET_REG_SET); - list_for_each_entry_safe(t, tmp_t, &m->transfers, transfer_list) { + list_for_each_entry(t, &m->transfers, transfer_list) { status = mxs_spi_setup_transfer(m->spi, t); if (status)