Skip to content

Commit

Permalink
spi: octeon: Use list_is_last() instead of open-coded
Browse files Browse the repository at this point in the history
Signed-off-by: Axel Lin <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
  • Loading branch information
AxelLin authored and broonie committed Feb 3, 2014
1 parent 38dbfb5 commit 0a4e210
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/spi/spi-octeon.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 0a4e210

Please sign in to comment.