LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Russell King - ARM Linux <linux@arm.linux.org.uk>
Cc: Liam Girdwood <lg@opensource.wolfsonmicro.com>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	linux-arm-kernel <linux-arm-kernel@lists.arm.linux.org.uk>
Subject: Re: [PATCH 4/6] regulator: regulator core.
Date: Sat, 23 Feb 2008 10:18:43 -0800	[thread overview]
Message-ID: <20080223101843.d7c001e7.akpm@linux-foundation.org> (raw)
In-Reply-To: <20080223095217.GA28356@flint.arm.linux.org.uk>

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.

  reply	other threads:[~2008-02-23 18:19 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-20 17:09 Liam Girdwood
2008-02-23  8:05 ` Andrew Morton
2008-02-23  9:52   ` Russell King - ARM Linux
2008-02-23 18:18     ` Andrew Morton [this message]
2008-02-23 19:26       ` ian
2008-02-23 19:38         ` Andrew Morton
2008-02-24  8:51         ` Pavel Machek
2008-02-24 22:47           ` ian
2008-02-24 10:23     ` Mark Brown
2008-02-24 11:18       ` Russell King - ARM Linux

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=20080223101843.d7c001e7.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=lg@opensource.wolfsonmicro.com \
    --cc=linux-arm-kernel@lists.arm.linux.org.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --subject='Re: [PATCH 4/6] regulator: regulator core.' \
    /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

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).