Thread (5 messages) 5 messages, 3 authors, 2015-03-31

Re: [PATCH] net: phy: at803x: simplify using devm_gpiod_get_optional and its 4th argument

From: David Miller <davem@davemloft.net>
Date: 2015-03-31 18:07:03

From: Uwe Kleine-König <redacted>
Date: Tue, 31 Mar 2015 19:53:47 +0200
On Tue, Mar 31, 2015 at 12:57:54PM -0400, David Miller wrote:
quoted
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.
quoted
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.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help