Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1378949

Re: [PATCH v3 3/3] drm: bridge: anx78xx: Add anx78xx driver support.

From Thierry Reding <treding@nvidia.com>
Newsgroups linux.kernel
Subject Re: [PATCH v3 3/3] drm: bridge: anx78xx: Add anx78xx driver support.
Date 2016-04-14 16:40 +0200
Message-ID <rnQB5-33W-53@gated-at.bofh.it> (permalink)
References (1 earlier) <rlEb0-3RN-23@gated-at.bofh.it> <rnPlE-2aV-5@gated-at.bofh.it> <rnPOH-2pl-35@gated-at.bofh.it> <rnQ81-2QW-5@gated-at.bofh.it> <rnQ81-2QW-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


[Multipart message — attachments visible in raw view] - view raw

On Thu, Apr 14, 2016 at 04:08:43PM +0200, Enric Balletbo i Serra wrote:
> Hi Emil,
> 
> On 14/04/16 16:06, Emil Velikov wrote:
> > Hi Enric,
> > 
> > On 14 April 2016 at 14:42, Enric Balletbo i Serra
> > <enric.balletbo@collabora.com> wrote:
> > > The patch was implemented first without OR'ing error codes. The reason why I
> > > changed this is because I received the comments that checking the error on
> > > every regmap_* didn't help the readability of the driver and is likely to
> > > not fail if the first call doesn't fail.
> > > 
> > > For example, originally the code was like this:
> > >    http://pastebin.com/rPgyji8k
> > > but I changed to this
> > >    http://pastebin.com/rPgyji8k
> > > 
> > Both links are the same ;-) But I believe we all get what you meant.
> > 
> 
> Ooops, sorry. This is the other link
> 
> 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

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v3 0/3] Add ANX7814 I2C bridge driver Enric Balletbo i Serra <enric.balletbo@collabora.com> - 2016-04-08 15:00 +0200
  [PATCH v3 2/3] devicetree: Add ANX7814 SlimPort transmitter binding. Enric Balletbo i Serra <enric.balletbo@collabora.com> - 2016-04-08 15:00 +0200
  Re: [PATCH v3 3/3] drm: bridge: anx78xx: Add anx78xx driver support. Thierry Reding <treding@nvidia.com> - 2016-04-14 15:20 +0200
    Re: [PATCH v3 3/3] drm: bridge: anx78xx: Add anx78xx driver support. Enric Balletbo i Serra <enric.balletbo@collabora.com> - 2016-04-14 15:50 +0200
      Re: [PATCH v3 3/3] drm: bridge: anx78xx: Add anx78xx driver support. Enric Balletbo i Serra <enric.balletbo@collabora.com> - 2016-04-14 16:10 +0200
        Re: [PATCH v3 3/3] drm: bridge: anx78xx: Add anx78xx driver support. Thierry Reding <treding@nvidia.com> - 2016-04-14 16:40 +0200
      Re: [PATCH v3 3/3] drm: bridge: anx78xx: Add anx78xx driver support. Emil Velikov <emil.l.velikov@gmail.com> - 2016-04-14 16:10 +0200

csiph-web