[Cbe-oss-dev] [PATCH] cell: abstract spu management routines

Geoff Levand geoffrey.levand at am.sony.com
Wed Nov 8 16:24:28 EST 2006


Michael Ellerman wrote:
>> +static struct platform_data *platform_data(struct spu *spu)
>> +{
>> +	BUG_ON(!spu->platform_data);
>> +	return (struct platform_data*)spu->platform_data;
>> +}
> 
> I don't see the point of this, why not just grab platform data directly?

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)->'?

-Geoff



More information about the cbe-oss-dev mailing list