On 26/02/16 10:52, Laurent Pinchart wrote:
for (i = i - 1; i >= 0; --i) {
Maybe i-- instead of i = i - 1 ?
Hmm I don't know... I do like assignment in the initializer more than i--. And why i--? Why not --i? =)
--i is fine with me too ;-) Or maybe
while (i--) dma_unmap_page(dev->dev, addrs[i], PAGE_SIZE, DMA_BIDIRECTIONAL);
Maybe it's just me, but I find it a bit difficult to decipher what exactly goes on there.
I think the original 'if' is the most clear one: start from i-1, do while i>=0, decrement by one. It's obvious with a quick glance, whereas with the 'while' I need to stop and think.
Tomi