Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755136AbcDNOcU (ORCPT ); Thu, 14 Apr 2016 10:32:20 -0400 Received: from hqemgate14.nvidia.com ([216.228.121.143]:8741 "EHLO hqemgate14.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754958AbcDNOcQ (ORCPT ); Thu, 14 Apr 2016 10:32:16 -0400 X-PGP-Universal: processed; by hqnvupgp07.nvidia.com on Thu, 14 Apr 2016 07:29:38 -0700 Date: Thu, 14 Apr 2016 16:32:04 +0200 From: Thierry Reding To: Enric Balletbo i Serra CC: Emil Velikov , devicetree , "Linux-Kernel@Vger. Kernel. Org" , ML dri-devel , David Airlie , "Rob Herring" , Daniel Kurtz , , Dan Carpenter , "Rob Herring" Subject: Re: [PATCH v3 3/3] drm: bridge: anx78xx: Add anx78xx driver support. Message-ID: <20160414143203.GD32237@ulmo.ba.sec> References: <1460119972-8658-1-git-send-email-enric.balletbo@collabora.com> <1460119972-8658-4-git-send-email-enric.balletbo@collabora.com> <20160414131013.GA32237@ulmo.ba.sec> <570F9E4D.7040401@collabora.com> <570FA46B.2080706@collabora.com> MIME-Version: 1.0 In-Reply-To: <570FA46B.2080706@collabora.com> X-NVConfidentiality: public User-Agent: Mutt/1.6.0 (2016-04-01) X-Originating-IP: [10.2.70.88] X-ClientProxiedBy: UKMAIL102.nvidia.com (10.26.138.15) To UKMAIL101.nvidia.com (10.26.138.13) Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="mSxgbZZZvrAyzONB" Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2418 Lines: 66 --mSxgbZZZvrAyzONB Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Apr 14, 2016 at 04:08:43PM +0200, Enric Balletbo i Serra wrote: > Hi Emil, >=20 > On 14/04/16 16:06, Emil Velikov wrote: > > Hi Enric, > >=20 > > On 14 April 2016 at 14:42, Enric Balletbo i Serra > > wrote: > > > The patch was implemented first without OR'ing error codes. The reaso= n why I > > > changed this is because I received the comments that checking the err= or on > > > every regmap_* didn't help the readability of the driver and is likel= y to > > > not fail if the first call doesn't fail. > > >=20 > > > For example, originally the code was like this: > > > http://pastebin.com/rPgyji8k > > > but I changed to this > > > http://pastebin.com/rPgyji8k > > >=20 > > Both links are the same ;-) But I believe we all get what you meant. > >=20 >=20 > Ooops, sorry. This is the other link >=20 > http://pastebin.com/e2KpGxHy I like the explicit checks better. Like I said, OR'ing the error codes makes you loose all context and likely give you many similar failures if for some reason regmap accesses always fail. Also you're code most likely is required to run in entirety for an operation to be successful. If the first part of the operation doesn't succeed it is natural to assume that the whole operation will fail, so there's no need (and a waste of time) to attempt any subsequent steps. Thierry --mSxgbZZZvrAyzONB Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAABCAAGBQJXD6njAAoJEN0jrNd/PrOhMz0QALbcy9IisIaqY8As0VaQ7vYV lZ+b78Xm4Ooll4yJLEo9SBZmz2fx7mXcd9coADsvLGqSLUn4PgxEzNLEs3XnMDnY oZV/ckTICrxp5EghTS8AyR+okK+d6vEICbsPf+R0syAgDbhZ4dO4jP5BTPsD5b8w dWFwyJjeZJNF5d4vsylAEGQFzVBY+RzowmVhisSuKYiAX8vC58NLI+b0SmOVuE2a H90PNk5N1V5RmT4IR4pa0xk7BWYnjGnmDECPWiB4De4jQj/8EkKLjjL9Az8qtE21 kB1GarEx8tZko3L0mR+7wv+yY9Mfubsj43vnAeSkJdpoAdbeqMi+4Q+Z3FowOzMS OW3M1vhj/mMkf/faQRlEN59rnC8b0DBL3yLfXfiggpremIXGY+7Q/Ar28vfdyOCH WP2fAHM8MjKY1Y/KTtj5ZbgKyRAYghMEh53LEq8N1l0eEagzCba7PaNURMKseLXW As2qVBpkFT+rRMcLiBfaZ5G553p28UWm44DKO46/60u94VKPbldvjDuSGGEtCObx NtCLTkkVL3eyZNFdS10hlqGlb4d657TdAeiCDGOec7QUNz9ayiMv/rDgtqlvKpW4 8iUlqNBrXyPgU3aPA8Fjvs0TB1V3QWDc0pCcrS1ytosikDSDYi3p8D80jknjtf64 h/qv05JHyUd4LqGvpJ4G =hnMl -----END PGP SIGNATURE----- --mSxgbZZZvrAyzONB--