From: Axel Lin Date: Wed, 15 Jan 2014 05:22:17 +0000 (+0800) Subject: spi: octeon: Use list_is_last() instead of open-coded X-Git-Tag: firefly_0821_release~176^2~4201^2~4^9~3 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=0a4e210e9965de3812df079fc70a702afc4445d2;p=firefly-linux-kernel-4.4.55.git spi: octeon: Use list_is_last() instead of open-coded Signed-off-by: Axel Lin Signed-off-by: Mark Brown --- diff --git a/drivers/spi/spi-octeon.c b/drivers/spi/spi-octeon.c index 67249a48b391..862ef30853d3 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;