diff mbox

spi: mxs: Use list_for_each_entry to iterate over transfer list

Message ID 1391593679.1420.1.camel@phoenix (mailing list archive)
State Accepted
Commit 9a7da6cc1d952b70284e34a594486045eadba8d5
Headers show

Commit Message

Axel Lin Feb. 5, 2014, 9:47 a.m. UTC
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 <axel.lin@ingics.com>
---
 drivers/spi/spi-mxs.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Marek Vasut Feb. 5, 2014, 5:14 p.m. UTC | #1
On Wednesday, February 05, 2014 at 10:47:59 AM, Axel Lin wrote:
> 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 <axel.lin@ingics.com>

Makes sense.

Acked-by: Marek Vasut <marex@denx.de>

Best regards,
Marek Vasut
--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Mark Brown Feb. 7, 2014, 12:20 p.m. UTC | #2
On Wed, Feb 05, 2014 at 05:47:59PM +0800, Axel Lin wrote:
> 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.

Applied, thanks.
diff mbox

Patch

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)