[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20070719021752.35cb7daa.akpm@linux-foundation.org>
Date: Thu, 19 Jul 2007 02:17:52 -0700
From: Andrew Morton <akpm@...ux-foundation.org>
To: Geert Uytterhoeven <Geert.Uytterhoeven@...ycom.com>
Cc: Paul Mackerras <paulus@...ba.org>, Jens Axboe <axboe@...nel.dk>,
"James E.J. Bottomley" <James.Bottomley@...elEye.com>,
Alessandro Rubini <rubini@...ion.unipv.it>,
linuxppc-dev@...abs.org, linux-kernel@...r.kernel.org,
linux-scsi@...r.kernel.org,
Geoff Levand <geoffrey.levand@...sony.com>
Subject: Re: [patch 2/3] ps3: BD/DVD/CD-ROM Storage Driver
On Thu, 19 Jul 2007 11:02:07 +0200 (CEST) Geert Uytterhoeven <Geert.Uytterhoeven@...ycom.com> wrote:
> On Wed, 18 Jul 2007, Andrew Morton wrote:
> > > +struct ps3rom_private {
> > > + struct ps3_storage_device *dev;
> > > + struct scsi_cmnd *curr_cmd;
> > > +};
> > > +#define ps3rom_priv(dev) ((dev)->sbd.core.driver_data)
> > > +
> >
> > Someone should invent a keyboard which delivers an electric shock when the
> > operator types "#define". In the meanwhile, I get to do the honours.
> >
> > Please don't implement in a macro anything which can be implemented in C.
>
> All I needed was a shorthand to access driver_data, for both read and write
> access (you cannot do the latter with C, unless you decouple read and write).
Oh dear.
ps3rom_priv(dev) = host;
that's 'orrid. We have an identifier pretending to be a function, only we
go and treat it as an lvalue.
I mean, C code should look like C code, and the above just doesn't.
Sigh.
-
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