lkml.org 
[lkml]   [2008]   [Feb]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 4/6] regulator: regulator core.
On Sat, 23 Feb 2008 09:52:17 +0000 Russell King - ARM Linux <linux@arm.linux.org.uk> wrote:

> On Sat, Feb 23, 2008 at 12:05:38AM -0800, Andrew Morton wrote:
> > On Wed, 20 Feb 2008 17:09:11 +0000 Liam Girdwood <lg@opensource.wolfsonmicro.com> wrote:
> >
> > > This patch provides the regulator framework core. The core also provides a
> > > sysfs interface for userspace information.
> > >
> > > ...
> > >
> > > +
> > > +/* We need to undef the current macro (from include/asm/current.h) otherwise
> > > + * our "current" sysfs entry becomes "(get_current())".
> > > + */
> > > +#undef current
> >
> > err, no ;) Please rename your stuff.
>
> Renaming is not an option - "current" is an electronic term for which
> there is no alternative.

amps, milliamps, amperage (the latter of which I've always disliked)

> The real problem is this __ATTR macro crap:
>
> + __ATTR(current, 0444, regulator_uA_show, NULL),

This interface would actually be *improved* if that sysfs file were named
"microamps" rather than "current". Because its units become
self-documenting. Similarly, s/voltage/millivolts/g

> #define __ATTR(_name,_mode,_show,_store) { \
> .attr = {.name = __stringify(_name), .mode = _mode }, \
> .show = _show, \
> .store = _store, \
> }
>
> If __ATTR allowed the name to be passed as a string, instead of stupidly
> stringifying it, then this wouldn't be needed. So I suggest that the
> #undef stands _until_ we fix this stupid macro.

yeah, macros suck.

> Or we rename the
> "current" macro to something that doesn't clash with accepted scientific
> and engineering terminology.


\
 
 \ /
  Last update: 2008-02-23 19:23    [W:0.069 / U:1.084 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site