[U-Boot] [PATCH v2 13/22] omap4: add clock support

Wolfgang Denk
2011-06-21T10:22:42Z

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

--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"Plan to throw one away. You will anyway."
- Fred Brooks, "The Mythical Man Month"