LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: David Brownell <david-b@pacbell.net>
To: linux-arm-kernel@lists.arm.linux.org.uk
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Liam Girdwood <lg@opensource.wolfsonmicro.com>,
	linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 1/6] regulator: consumer driver regulator control framework.
Date: Sat, 23 Feb 2008 10:36:42 -0800	[thread overview]
Message-ID: <200802231036.42652.david-b@pacbell.net> (raw)
In-Reply-To: <20080223000528.c01e1b51.akpm@linux-foundation.org>

On Saturday 23 February 2008, Andrew Morton wrote:
> On Wed, 20 Feb 2008 17:08:53 +0000 Liam Girdwood <lg@opensource.wolfsonmicro.com> wrote:
> > +#define mV_to_uV(mV)	(mV * 1000)
> > +#define uV_to_mV(uV)	(uV / 1000)
> > +#define V_to_uV(V)	(mV_to_uV(V * 1000))
> > +#define uV_to_V(uV)	(uV_to_mV(uV) / 1000)
> > +#define mA_to_uA(mA)	(mA * 1000)
> > +#define uA_to_mA(uA)	(uA / 1000)
> > +#define A_to_uA(A)	(mA_to_uA(A * 1000))
> > +#define uA_to_A(uA)	(uA_to_mA(uA) / 1000)
> 
> hm.  It might be nicer to make these static inline functions.  Especially
> if the code is consistent about what C type is used to represent voltage
> and current.

And if not ... then be sure to use e.g. ((mV) * 1000), ((uV) / 1000) etc
so that params like "x + 23" can't cause chaos.

(FWIW oth these points -- use inlines, parenthesize params -- are also
found in Documentation/CodingStyle.)

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

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-20 17:08 Liam Girdwood
2008-02-23  8:05 ` Andrew Morton
2008-02-23 18:36   ` David Brownell [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=200802231036.42652.david-b@pacbell.net \
    --to=david-b@pacbell.net \
    --cc=akpm@linux-foundation.org \
    --cc=lg@opensource.wolfsonmicro.com \
    --cc=linux-arm-kernel@lists.arm.linux.org.uk \
    --cc=linux-kernel@vger.kernel.org \
    --subject='Re: [PATCH 1/6] regulator: consumer driver regulator control framework.' \
    /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).