From: Dan Carpenter <dan.carpenter@oracle.com>
To: Enric Balletbo i Serra <enric.balletbo@collabora.com>
Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
dri-devel@lists.freedesktop.org, devel@driverdev.osuosl.org,
treding@nvidia.com, robh+dt@kernel.org, pawel.moll@arm.com,
mark.rutland@arm.com, ijc+devicetree@hellion.org.uk,
galak@codeaurora.org, airlied@linux.ie,
gregkh@linuxfoundation.org, sjoerd.simons@collabora.co.uk,
javier@dowhile0.org, span@analogixsemi.com,
nathan.chung@mediatek.com, djkurtz@chromium.org,
drinkcat@chromium.org, laurent.pinchart@ideasonboard.com,
jb.tsai@mediatek.com, cawa.cheng@mediatek.com,
eddie.huang@mediatek.com, cjiao@analogixsemi.com,
emil.l.velikov@gmail.com
Subject: Re: [PATCH 3/3] drm: bridge: anx78xx: Add anx78xx bridge driver support.
Date: Thu, 24 Mar 2016 14:28:18 +0300 [thread overview]
Message-ID: <20160324112818.GC5273@mwanda> (raw)
In-Reply-To: <1458816106-11596-4-git-send-email-enric.balletbo@collabora.com>
On Thu, Mar 24, 2016 at 11:41:46AM +0100, Enric Balletbo i Serra wrote:
> + /* Map slave addresses of ANX7814 */
> + for (i = 0; i < I2C_NUM_ADDRESSES; i++) {
> + anx78xx->i2c_dummy[i] = i2c_new_dummy(client->adapter,
> + anx78xx_i2c_addresses[i] >> 1);
> + if (!anx78xx->i2c_dummy[i]) {
> + DRM_ERROR("Failed to reserve i2c bus %02x.\n",
> + anx78xx_i2c_addresses[i]);
Missing error code here.
> + goto err_i2c;
> + }
I'm, of course, not a fan of the naming. The name should be based on
what the goto location does... In this case it turns it off. Which is
slightly weird because we have not turned it on yet... I always say
that you should have multiple error labels and you only undo things
which have been done.
Having a common exit path for the other functions where it was "goto out"
makes sense. But again in those cases I would prefer a meaningful label
name like "goto unlock;". In the kernel "goto out;" is meaningless, it
could do anything or everything or nothing. A lot of people like it
of course, but out: label code tends to be buggier than using a
meaningful name.
regards,
dan carpenter
next prev parent reply other threads:[~2016-03-24 11:28 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-24 10:41 [PATCH 0/3] Add ANX7814 I2C bridge driver Enric Balletbo i Serra
[not found] ` <1458816106-11596-1-git-send-email-enric.balletbo-ZGY8ohtN/8qB+jHODAdFcQ@public.gmane.org>
2016-03-24 10:41 ` [PATCH 1/3] of: Add vendor prefix for Analogix Semiconductor Enric Balletbo i Serra
2016-03-25 14:22 ` Rob Herring
2016-03-24 10:41 ` [PATCH 2/3] devicetree: Add ANX7814 bridge binding Enric Balletbo i Serra
[not found] ` <1458816106-11596-3-git-send-email-enric.balletbo-ZGY8ohtN/8qB+jHODAdFcQ@public.gmane.org>
2016-03-25 14:36 ` Rob Herring
2016-03-24 10:41 ` [PATCH 3/3] drm: bridge: anx78xx: Add anx78xx bridge driver support Enric Balletbo i Serra
2016-03-24 11:28 ` Dan Carpenter [this message]
2016-03-28 12:03 ` Emil Velikov
2016-03-24 12:03 ` kbuild test robot
[not found] ` <1458816106-11596-4-git-send-email-enric.balletbo-ZGY8ohtN/8qB+jHODAdFcQ@public.gmane.org>
2016-03-24 12:03 ` [PATCH] drm: bridge: anx78xx: fix ptr_ret.cocci warnings kbuild test robot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160324112818.GC5273@mwanda \
--to=dan.carpenter@oracle.com \
--cc=airlied@linux.ie \
--cc=cawa.cheng@mediatek.com \
--cc=cjiao@analogixsemi.com \
--cc=devel@driverdev.osuosl.org \
--cc=devicetree@vger.kernel.org \
--cc=djkurtz@chromium.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=drinkcat@chromium.org \
--cc=eddie.huang@mediatek.com \
--cc=emil.l.velikov@gmail.com \
--cc=enric.balletbo@collabora.com \
--cc=galak@codeaurora.org \
--cc=gregkh@linuxfoundation.org \
--cc=ijc+devicetree@hellion.org.uk \
--cc=javier@dowhile0.org \
--cc=jb.tsai@mediatek.com \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=nathan.chung@mediatek.com \
--cc=pawel.moll@arm.com \
--cc=robh+dt@kernel.org \
--cc=sjoerd.simons@collabora.co.uk \
--cc=span@analogixsemi.com \
--cc=treding@nvidia.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).