Re: [PATCH 2/2] x86 platform driver: intelligent power sharingdriver

From: Andrew Morton
Date: Tue May 11 2010 - 14:41:15 EST


On Tue, 11 May 2010 11:18:54 -0700 Jesse Barnes <jbarnes@xxxxxxxxxxxxxxxx> 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.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/