From: David Miller <davem@davemloft.net>
To: u.kleine-koenig@pengutronix.de
Cc: f.fainelli@gmail.com, netdev@vger.kernel.org,
linus.walleij@linaro.org, acourbot@nvidia.com
Subject: Re: [PATCH] net: phy: at803x: simplify using devm_gpiod_get_optional and its 4th argument
Date: Tue, 31 Mar 2015 14:07:00 -0400 (EDT) [thread overview]
Message-ID: <20150331.140700.1574593248925827837.davem@davemloft.net> (raw)
In-Reply-To: <20150331175347.GL17728@pengutronix.de>
From: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Date: Tue, 31 Mar 2015 19:53:47 +0200
> On Tue, Mar 31, 2015 at 12:57:54PM -0400, David Miller wrote:
>> 1) It potentially leaves an error pointer in priv->gpiod_reset
>> and I explicitly tell people to NEVER do this as it tests as
>> non-NULL by cleanup code and therefore might be mistakenly
>> used.
> If priv->gpiod_reset is an error value it makes the probe routine return
> this error (after point 2 is addressed), which should end the lifetime
> of the structure containing the value.
It doesn't matter, it's a dangerous practice and not doing so makes
sure that no matter how this code is ever changed nobody can run into
potential problems due to this.
>> I really hate changes like this, don't try to be too cute unless
>> you fully understand the full repurcussions and the reasons why
>> someone did things one way or another.
> I think I did understand the code, so I will resend with
> PTR_ERR_OR_ZERO assuming it was you who didn't understood my change
> regarding the other two issues you pointed out.
I'm not applying this patch if you keep putting error pointers into
the structure member.
Please do not fight me on this, I do not consider your changes an
improvement at all.
prev parent reply other threads:[~2015-03-31 18:07 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-27 19:25 [PATCH] net: phy: at803x: simplify using devm_gpiod_get_optional and its 4th argument Uwe Kleine-König
2015-03-28 4:52 ` Alexandre Courbot
2015-03-31 16:57 ` David Miller
2015-03-31 17:53 ` Uwe Kleine-König
2015-03-31 18:07 ` David Miller [this message]
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=20150331.140700.1574593248925827837.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=acourbot@nvidia.com \
--cc=f.fainelli@gmail.com \
--cc=linus.walleij@linaro.org \
--cc=netdev@vger.kernel.org \
--cc=u.kleine-koenig@pengutronix.de \
/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).