Re: [PATCH V2 2/2] ARM: SAMSUNG: Cleanup resources by using macro

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Oct 5, 2011 at 12:26 AM, Arnd Bergmann <arnd@xxxxxxxx> wrote:
> On Tuesday 04 October 2011, Kukjin Kim wrote:
>> > I think the string concatenation really just obfuscates the code, and
>> > it does not actually save much at all. When you replace
>> >
>> > +       [0] = SAMSUNG_RES_MEM(S3C, WDT, SZ_1K),
>> > +       [1] = SAMSUNG_RES_IRQ(WDT),
>> >
>> > with
>> >
>> > +       [0] = DEFINE_RES_MEM(S3C_PA_WDT, SZ_1K),
>> > +       [1] = DEFINE_RES_IRQ(IRQ_WDT),
>> >
>> > you need practically no extra space, but you gain the advantages that
>> >
>> > * Someone using grep for DEFINE_RES_MEM finds all memory resources without
>> >   having to look up what your macros do an where they are used.
>> > * Someone using grep to look for S3C_PA_WDT finds the place where it is
>> used.
>> > * Someone reading the resource definition immediately knows what the
>> >   macro does if familiar with other platforms using that macro.
>>
>> Yes, right. But I'm preparing to reduce the 'soc' part to consolidate some
>> duplicated resources and platform data after this and the new SAMSUNG_RES
>> macro will be used.
There are tools for source browsing e.g., ctags, cscope, grep, git
grep and so on.
If you create new SAMSUNG_RES, these tools can't find macro and
symbols properly.

Please use the existing macros for own purpose.

Thank you,
Kyungmin Park
>
> Hmm, can't you instead change the names of these constants to be
> always the same? That would let you use the regular DEFINE_RES_*
> definitions without having to introduce your own.
>
>        Arnd
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@xxxxxxxxxxxxxxxxxxx
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
>
--
To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux SoC Development]     [Linux Rockchip Development]     [Linux USB Development]     [Video for Linux]     [Linux Audio Users]     [Linux SCSI]     [Yosemite News]

  Powered by Linux