From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Subject: Re: [Cbe-oss-dev] [PATCH] cell: abstract spu management routines From: Michael Ellerman To: Geoff Levand In-Reply-To: <45517325.3090808@am.sony.com> References: <455161D2.3090004@am.sony.com> <1162962074.20271.16.camel@localhost.localdomain> <45516A0C.5050607@am.sony.com> <1162965270.20271.22.camel@localhost.localdomain> <45517325.3090808@am.sony.com> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-fCSAQ9CZ+Zxh8/Vjbgu+" Date: Wed, 08 Nov 2006 17:06:49 +1100 Message-Id: <1162966009.20271.33.camel@localhost.localdomain> Mime-Version: 1.0 Cc: linuxppc-dev@ozlabs.org, cbe-oss-dev@ozlabs.org, Arnd Bergmann Reply-To: michael@ellerman.id.au List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , --=-fCSAQ9CZ+Zxh8/Vjbgu+ Content-Type: text/plain Content-Transfer-Encoding: quoted-printable On Tue, 2006-11-07 at 22:03 -0800, Geoff Levand wrote: > Michael Ellerman wrote: > > On Tue, 2006-11-07 at 21:24 -0800, Geoff Levand wrote: > >> Michael Ellerman wrote: > >> >> +static struct platform_data *platform_data(struct spu *spu) > >> >> +{ > >> >> + BUG_ON(!spu->platform_data); > >> >> + return (struct platform_data*)spu->platform_data; > >> >> +} > >> >=20 > >> > I don't see the point of this, why not just grab platform data direc= tly? > >>=20 > >> Well, first, it does a check, and second, you can't just grab platform= _data, > >> you need to always do the cast also. So then, is something like > >> '((struct platform_data*)spu->platform_data)->' preferred over > >> 'platform_data(spu)->'? > >=20 > > Yeah OK I missed the cast, I guess it's worth it then. In that case can > > you change the names? Having the struct, the member and the accessor al= l > > named the same is a bit confusing. > >=20 > > The BUG() is pretty superfluous, you're just preempting the NULL deref > > by 1 instruction. >=20 > OK, I'll do the name changes as Ben suggested. Cool, heh sorry to double-team you, I hadn't read Ben's mail :) > Actually, that BUG check was just a stale leftover from when I was gettin= g things working :) No worries. cheers --=20 Michael Ellerman OzLabs, IBM Australia Development Lab wwweb: http://michael.ellerman.id.au phone: +61 2 6212 1183 (tie line 70 21183) We do not inherit the earth from our ancestors, we borrow it from our children. - S.M.A.R.T Person --=-fCSAQ9CZ+Zxh8/Vjbgu+ Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.3 (GNU/Linux) iD8DBQBFUXP5dSjSd0sB4dIRAtVAAJ9y+PA+vGxYsNNdcypXgliOTTriCACeKr9W Pp2yRdyItcKVeNnsrOrDJMQ= =4a/s -----END PGP SIGNATURE----- --=-fCSAQ9CZ+Zxh8/Vjbgu+--