lkml.org 
[lkml]   [2012]   [Feb]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] regulator: Fix and simplify debugfs support
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.
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2012-02-20 22:01    [W:0.055 / U:0.028 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site