Skip to contentSkip to conversation

spi: mxs: Use list_for_each_entry to iterate over transfer list

PATCH Applied Axel Lin 3 participants 3 messages Feb 5, 2014 – Feb 7, 2014

Subsystems (2)
lore
Share & tools
lore

Axel Lin

author
#0 lore raw

PATCH 1/1 spi: mxs: Use list_for_each_entry to iterate over transfer list

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.

---
 drivers/spi/spi-mxs.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/spi/spi-mxs.c +2 -2
index 17bb9a9..4208f24 100644
@@ -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)
Signature · 8 lines
1.8.1.2



--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Acked-by on v1 1/1
#1 lore raw
Quoted 4 lines · Axel Lin

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.

Makes sense.

Best regards,
Marek Vasut
--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

Applied
#2 lore raw
In reply to Axel Lin
Quoted 2 lines · Axel Lin

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.