Santosh Shilimkar <santosh.shilim...@ti.com> writes:

>> -----Original Message-----
>> From: Premi, Sanjeev [mailto:pr...@ti.com]
>> Sent: Thursday, January 06, 2011 8:03 PM
>> To: Shilimkar, Santosh; linux-omap@vger.kernel.org
>> Cc: Hilman, Kevin; t...@atomide.com; linux-arm-
>> ker...@lists.infradead.org; Shilimkar, Santosh; Paul Walmsley
>> Subject: RE: [PATCH v2 2/5] omap2plus: prm: Trvial build break fix
>> for undefined reference to 'omap2_prm_read_mod_reg'
>>
>> > -----Original Message-----
>> > From: linux-omap-ow...@vger.kernel.org
>> > [mailto:linux-omap-ow...@vger.kernel.org] On Behalf Of
>> > Santosh Shilimkar
>> > Sent: Wednesday, January 05, 2011 4:27 PM
>> > To: linux-omap@vger.kernel.org
>> > Cc: Hilman, Kevin; t...@atomide.com;
>> > linux-arm-ker...@lists.infradead.org; Shilimkar, Santosh;
>> > Paul Walmsley
>> > Subject: [PATCH v2 2/5] omap2plus: prm: Trvial build break
>> > fix for undefined reference to 'omap2_prm_read_mod_reg'
>>
>> [snip]
>>
>> >
>> >  #ifndef __ASSEMBLER__
>> > -
>> > +/*
>> > + * Stub omap2xxx/omap3xxx functions so that common files
>> > + * continue to build when custom builds are used
>> > + */
>> > +#if defined(CONFIG_ARCH_OMAP4) &&
>> > !(defined(CONFIG_ARCH_OMAP2) ||    \
>> > +                                  defined(CONFIG_ARCH_OMAP3))
>> > +static inline u32 omap2_prm_read_mod_reg(s16 module, u16 idx)
>> > +{
>> > +  WARN_ONCE(1, "prm: omap2xxx/omap3xxx specific function and "
>> > +          "not suppose to be used on omap4\n");
>> > +  return 0;
>> > +}
>> Looking forward, the warning of incorrect SOC may be required
>> for when kernel is build for one specific SOC.
>>
>> Wouldn't it be easy/better to have common global function:
>>
>> void wrong_soc(char* func, int soc_id)
>> {
>>      WARN_ONCE(1, "Function %s cannot be used for %d", func,
>> soc_id);
>> }
>>
>> OR we could have soc specific functions e.g.
>>
>> void omap2xxx_only (char* func)
>> {
>>      WARN_ONCE(1, "Function %s is specific to OMAP2XXX");
>> }
>> ..etc..
>>
>> Later these functions can be called from the stubs.
>>
>> This is prelim idea, will need to be worked upon.
>>
> Not sure. May appear like over engineering considering it's a
> stub.
> Paul can comment.

I guess Sanjeev's approach is meant eliminate duplicate strings that
waste space.

Sanjeev, did you check whether multiple copies of the exact same string
actually exist in the binary?  I'm wondering if gcc is smart enough to
only have one copy of the string (but have doubts.)

Kevin
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to