[PATCH 11/33] drm/omap: use dma_mapping_error in omap_gem_attach_pages

Tomi Valkeinen tomi.valkeinen at ti.com
Fri Feb 26 09:07:07 UTC 2016


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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <https://lists.freedesktop.org/archives/dri-devel/attachments/20160226/784d0d84/attachment.sig>


More information about the dri-devel mailing list