From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tomi Valkeinen Subject: Re: [PATCH 11/33] drm/omap: use dma_mapping_error in omap_gem_attach_pages Date: Fri, 26 Feb 2016 11:07:07 +0200 Message-ID: <56D015BB.7040706@ti.com> References: <1455875288-4370-1-git-send-email-tomi.valkeinen@ti.com> <7707410.Pkpu1GDU6i@avalon> <56CF2037.1090008@ti.com> <1911061.OjUfkHxRtX@avalon> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1055480222==" Return-path: Received: from bear.ext.ti.com (bear.ext.ti.com [192.94.94.41]) by gabe.freedesktop.org (Postfix) with ESMTPS id AE3766EA3C for ; Fri, 26 Feb 2016 09:07:13 +0000 (UTC) In-Reply-To: <1911061.OjUfkHxRtX@avalon> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" To: Laurent Pinchart Cc: dri-devel@lists.freedesktop.org List-Id: dri-devel@lists.freedesktop.org --===============1055480222== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="jIffsRDDQrrv7s99TMw8btvqFthnMdCmd" --jIffsRDDQrrv7s99TMw8btvqFthnMdCmd Content-Type: multipart/mixed; boundary="3Q4HQ2JFexrfEVjGJ2waHLQEUMsCnNrQp" From: Tomi Valkeinen To: Laurent Pinchart Cc: dri-devel@lists.freedesktop.org, Rob Clark Message-ID: <56D015BB.7040706@ti.com> Subject: Re: [PATCH 11/33] drm/omap: use dma_mapping_error in omap_gem_attach_pages References: <1455875288-4370-1-git-send-email-tomi.valkeinen@ti.com> <7707410.Pkpu1GDU6i@avalon> <56CF2037.1090008@ti.com> <1911061.OjUfkHxRtX@avalon> In-Reply-To: <1911061.OjUfkHxRtX@avalon> --3Q4HQ2JFexrfEVjGJ2waHLQEUMsCnNrQp Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 26/02/16 10:52, Laurent Pinchart wrote: >>>> + >>>> + for (i =3D i - 1; i >=3D 0; --i) { >>> >>> Maybe i-- instead of i =3D i - 1 ? >> >> Hmm I don't know... I do like assignment in the initializer more than >> i--. And why i--? Why not --i? =3D) >=20 > --i is fine with me too ;-) Or maybe >=20 > 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>=3D0, decrement by one. It's obvious with a quick glance, whereas= with the 'while' I need to stop and think. Tomi --3Q4HQ2JFexrfEVjGJ2waHLQEUMsCnNrQp-- --jIffsRDDQrrv7s99TMw8btvqFthnMdCmd Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJW0BW7AAoJEPo9qoy8lh71szEQAKGceTj7rhksQl7uUS9p26Un iTHT7fC1Bm+8XLD4AP89E1ig3djsq2y6W2hFJrHXKuog1WRklulzs0Ga1nMrkFws EIPULUbrwY9b4uBJ1Yanu6NFCZjTPgSaFY6MKyRmDML12sdJ6D0eBd96JqMmvb3X CDhYT62MPmriRC9HwnRekMBtOMIltRXxyDhkUFZkVBLpX/9zRlxuRjXmok8cF3GK LPtu25Nt0ZGU41f2ux8UtiMXyEBlaSd/GcuN9BpqpeygTJ/+aDAoFqN9L1Ze238Y 2pypzmtnpamHC2dGxoLjnmQmR3dCtKccTXnYFXZAmaiZAqkkEOnSpcvGO1R1rjy1 5Xj3wRUdIiVsxsrMaLJKq6Hg74zvdPpDxGJxJC6+a34r9GL/cWy0ImIh//WWyvjO q+OsK3iHu/DX2hpccfL4ER8cgUAAVQ3+QG3Twpy889jbuafQzndZzjoVR1L5Nmzq StbzALqBMruj0yDjpinupoh3hP5gQCIeA5GV7046//hmsH5OtzYzkHBzm9h5D6wF XeWqU8dcEt50+RYvEsF5s4J2Rtk7hbiUTJbLqOS6N2cYTpkVe1IoLdedJqILD3BJ lyHmGcntc2XHe2wg6NecsarhIAXEjPH4yyb+VmOU+sq6daaCCrquvltUFBhGRhfo e0UGNvOqMxsAVtXe+q/X =j1pm -----END PGP SIGNATURE----- --jIffsRDDQrrv7s99TMw8btvqFthnMdCmd-- --===============1055480222== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KZHJpLWRldmVs IG1haWxpbmcgbGlzdApkcmktZGV2ZWxAbGlzdHMuZnJlZWRlc2t0b3Aub3JnCmh0dHBzOi8vbGlz dHMuZnJlZWRlc2t0b3Aub3JnL21haWxtYW4vbGlzdGluZm8vZHJpLWRldmVsCg== --===============1055480222==--