[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <200802231036.42652.david-b@pacbell.net>
Date: Sat, 23 Feb 2008 10:36:42 -0800
From: David Brownell <david-b@...bell.net>
To: linux-arm-kernel@...ts.arm.linux.org.uk
Cc: Andrew Morton <akpm@...ux-foundation.org>,
Liam Girdwood <lg@...nsource.wolfsonmicro.com>,
linux-kernel <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 1/6] regulator: consumer driver regulator control framework.
On Saturday 23 February 2008, Andrew Morton wrote:
> On Wed, 20 Feb 2008 17:08:53 +0000 Liam Girdwood <lg@...nsource.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.)
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists