
Dear Aneesh V,
In message 4E005F9E.8050003@ti.com you wrote:
In my function I am using 3 such arrays with quite a few entries in them. Won't it look ugly besides increasing the stack footprint.
I don;t see a significant difference whether you declare these arrays inside a function or with file scope.
Regarding the stack footprint: this would actually even be preferrable (assuming this code is run after relocation to RAM), and from what I've seen in the example, the compiler actually optimizes the code and does not really allocate such an array if you don't use it otherwise (like passing it to other functions).
Or, how about using a utility macro and make it look better like this:
#define OMAP4_PRCM_REG_ADDR(reg)\ (&(((struct my_regs_struct *)OMAP4_PRCM_BASE)->reg))
I consider this code too ugly.
Best regards,
Wolfgang Denk