[PATCH 01/11] OMAP4: PRCM: add OMAP4-specific accessor/mutatorfunctions

Cousson, Benoit b-cousson at ti.com
Wed Dec 15 07:43:03 EST 2010


On 12/15/2010 7:48 AM, Paul Walmsley wrote:
> Hi Rajendra
>
> On Wed, 8 Dec 2010, Rajendra Nayak wrote:
>
>> Would it help if we can avoid one more level of function
>> indirection (given that these are low level apis) and store
>> the Partition offsets in the tables above (instead of func
>> pointers) and do some thing like this.
>>
>>        return __raw_readl(OMAP2_L4_IO_ADDRESS(cm_read_offset[part],
>> module, idx));
>>
>> with the table entries of cm_read_offset looking something like
>>> +   [OMAP4430_PRM_PARTITION]                = OMAP4430_PRM_BASE,
>>> +   [OMAP4430_CM1_PARTITION]                = OMAP4430_CM1_BASE,
>>> +   [OMAP4430_CM2_PARTITION]                = OMAP4430_CM2_BASE,
>
> I did a version of this patch without the extra level of indirection.
> I'm not sure if it's better or worse.  The original seems conceptually
> cleaner to me, but this revised version is probably slightly more
> efficient.  Do you (or anyone else) have a strong preference?

I do not have a strong but a slight preference for that. It is a little 
bit more readable that function pointers for my point of view.

On the other hand, the function pointers might allow to handle tricky 
differences that this solution will not.

Regards,
Benoit



More information about the linux-arm-kernel mailing list