From mboxrd@z Thu Jan 1 00:00:00 1970 From: Scott Wood Date: Fri, 14 Sep 2012 14:01:24 -0500 Subject: [U-Boot] [PATCH v2 02/11] S3C24XX: Add core support for Samsung's S3C24XX SoCs In-Reply-To: <201209142025.25953.marex@denx.de> References: <1347643742-19966-1-git-send-email-jose.goncalves@inov.pt> <201209142003.00478.marex@denx.de> <505375E3.6050005@inov.pt> <201209142025.25953.marex@denx.de> Message-ID: <20120914190124.GA5157@buserror.net> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Fri, Sep 14, 2012 at 08:25:25PM +0200, Marek Vasut wrote: > Dear Jos? Miguel Gon?alves, > > > Hi Marek, > > > > On 14-09-2012 19:03, Marek Vasut wrote: > > > Dear Jos? Miguel Gon?alves, > > > > > > It's getting better :) > > > > Hopefully :-) > > > > > [...] > > > > > >> + > > >> +typedef ulong(*getfreq) (void); > > > > > > Is this used? > > > > In the array declaration bellow... > > Why, these are only values, no ? They're function pointers. If they were values the compiler should complain, because "getfreq" is used as the type of the array. > > >> +static const getfreq freq_f[] = { > > > > > > const array const members, no? > > > > Do you mean I should declare it like this: > > > > static const getfreq const freq[] = { ... > > Yes Why? When can you ever change what an array (not a pointer) points to? > > I don't see the point because an array has no other storage besides it's > > elements. Moreover GCC generates the same object code in both ways. > > Type checking, if you ever decided to write into the array, it'll prevent you > from doing so. The first const takes care of that. -Scott