[PATCH] spufs split off platform code

Geoff Levand geoffrey.levand at am.sony.com
Fri Feb 3 09:47:12 EST 2006


Arnd Bergmann wrote:
> I guess that the "spc" device type can be removed now, I don't think
> that
> any systems are left that have not been converted.
> 
> Do you have "spe" type nodes at all? Is there anything that you need to
> do different about them?


Yes, scp can be removed.  I think we can arrange it so some of the
create_spu code can go back to generic code.  Still investigating...


>>+void spu_free_irqs(struct spu *spu)
>>+{
>>+�������int irq_base;
>>+
>>+�������if(!spu->priv_data) {
>>+���������������pr_debug("null priv_data in %p\n", spu);
>>+���������������return;
>>+�������}
> 
> 
> It may be just me, but I don't like this bit of coding style:
> You are trying to deal with priv_data being either allocated
> or not allocated at this point. Better make sure that you have
> freed the structure before returning an error from any function
> that would allocate it on success. Then get rid of the check
> here.


Yes, it really doesn't add any value does it.


>>+struct spu_priv_data;
>>+struct spu_phys {
>>+�������unsigned long addr;
>>+�������unsigned long size;
>>+};
>>
>>�struct spu {
>>+�������struct spu_priv_data *priv_data; /* opaque */
>>��������char *name;
> 
> 
> If you want priv_data to point to different types of data structures
> depending on the context, I find it easier to understand if there is
> a simple void pointer and the actual struct definitions have different
> type names.


Yes, a good tip.


I'm looking into pushing these differences down into the lower level
platform code.  Hopefully it will simplify these parts.

-Geoff




More information about the Linuxppc64-dev mailing list