From: Mark Brown <broonie@opensource.wolfsonmicro.com>
To: Stephen Boyd <sboyd@codeaurora.org>
Cc: Liam Girdwood <lrg@ti.com>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] regulator: Fix and simplify debugfs support
Date: Mon, 20 Feb 2012 12:57:57 -0800 [thread overview]
Message-ID: <20120220205756.GA3052@opensource.wolfsonmicro.com> (raw)
In-Reply-To: <4F41FA60.7090503@codeaurora.org>
[-- Attachment #1: Type: text/plain, Size: 1230 bytes --]
On Sun, Feb 19, 2012 at 11:46:40PM -0800, Stephen Boyd wrote:
> On 2/19/2012 6:12 PM, Mark Brown wrote:
> >This was actually a deliberate decision to make the code more robust
> >against change - the IS_ERR_OR_NULL doesn't make the code any bigger but
> >it means it's less likely to break in the face of changes.
> More robust? The debugfs code in the regulator core looks confused
> on what the return value is. Sometimes it's IS_ERR, sometimes it's
> NULL, sometimes it's both. Might as well clean it up to be
> consistent and proper.
Well, the intention when I originally wrote it was to always check for
all possible error codes. Looking at the code in mainline it's pretty
consistent, the class wide check and the per rdev checks are both open
coded IS_ERR_OR_NULL() and the per supply stuff uses the helper. The
only case where we do a plain IS_ERR() is when we warn about not being
able to create supply_map and the consistent thing there would just be
to ignore the error since it's what we do for all the other individual
files.
This thing with returning NULL instead of an actual ERR_PTR() is pretty
unhelpful really, especially for something like debugfs where the caller
shouldn't care much if it works or not.
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
prev parent reply other threads:[~2012-02-20 20:58 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-19 7:28 [PATCH] regulator: Fix and simplify debugfs support Stephen Boyd
2012-02-19 7:51 ` Hillf Danton
2012-02-20 2:12 ` Mark Brown
2012-02-20 7:46 ` Stephen Boyd
2012-02-20 20:57 ` Mark Brown [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=20120220205756.GA3052@opensource.wolfsonmicro.com \
--to=broonie@opensource.wolfsonmicro.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lrg@ti.com \
--cc=sboyd@codeaurora.org \
/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).