lkml.org 
[lkml]   [2010]   [May]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 2/2] x86 platform driver: intelligent power sharing driver
On Tue, 11 May 2010 11:38:36 -0400
Andrew Morton <akpm@linux-foundation.org> wrote:

> On Tue, 11 May 2010 11:18:54 -0700 Jesse Barnes <jbarnes@virtuousgeek.org> wrote:
>
> > > > > +#define thm_writeb(off, val) writeb((val), ips->regmap + (off))
> > > > > +#define thm_writew(off, val) writew((val), ips->regmap + (off))
> > > > > +#define thm_writel(off, val) writel((val), ips->regmap + (off))
> > > >
> > > > ick.
> > > >
> > > > static inline unsigned short thm_readw(struct ips_driver *ips, unsigned offset)
> > > > {
> > > > readw(ips->regmap + offset);
> > > > }
> > > >
> > > > would be nicer.
> > >
> > > Yes, it would.
> >
> > No, I take that back, it just means more typing. This idiom of
> > expecting a given variable to be declared for the IO routines to work
> > is pretty common in drivers,
>
> yeah, but it sucks there, too.
>
> > and saves a bunch of redundant "(ips," everywhere...
>
> It's not redundant - it's C.
>
> grr.

No, it's CPP; this is exactly what preprocessor abuse was intended
for. :)

But it's a mechanical search & replace if someone feels strongly about
it. I'd like to avoid the typing though.

--
Jesse Barnes, Intel Open Source Technology Center


\
 
 \ /
  Last update: 2010-05-12 10:11    [from the cache]
©2003-2011 Jasper Spaans