From: Wolfgang Denk Date: Tue, 20 Mar 2012 09:39:29 +0100 Subject: [U-Boot] [PATCH V2] i.MX28: Drop __naked function from spl_mem_init In-Reply-To: <4F683862.4030709@denx.de> References: <1331933563-5865-1-git-send-email-marex@denx.de> <4F683862.4030709@denx.de> Message-ID: <20120320083929.94A98202A50@gemini.denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Dear Stefano, In message <4F683862.4030709@denx.de> you wrote: > > > + /* The following is "subs pc, r14, #4", used as return from DABT. */ > > + const uint32_t data_abort_memdetect_handler = 0xe25ef004; ... > Are we maybe becoming warning addicted ? I know the reason for this (GCC > raises a warning "-fstack-usage not supported for this target"), you > have already asked the gcc people about this issue, and I do not have an > idea how to fix this warning in a different way as you did. This is a > sort of self-modifying code. In which way is this self-modifying code? I don't think so. > However, the original code is quite easy to understand - I cannot say > the same after the patch, we rely on the comment to understand something. That's what comments are made for :-) > Should we really fix such as warnings even if we generate some obscured > code ? Wolfgang, what do you think about ? Yes, we should fix warnings. If you run a MAKEALL and can be sure that any message printed is a new problem you will not miss it, and act as needed. If youy know that a build will pop up a number or warnings, it's all too easy to miss if there is a new one - and checking takes much more concentration. This is to be avoided. On the other hand, I agree that we should avoid obscure code as well. But then, to me the assembler code "subs pc, r14, #4" is already obscure enough - I have to admit that I don't really grok it, nor why this needs to be a __naked function. My understanding is that to avoid the warning we can either use this "pre-compiled constant instruction" trick, or we would have to create a new assembler source file for this single instruction function. When Marek and I discussed this, the constant seemed to be the simplest approach (not the nicest, though). If you don't like it, then we I think we will end up with a new tiny assembler source file. Would that be preferred by you? 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 Many companies that have made themselves dependent on [the equipment of a certain major manufacturer] (and in doing so have sold their soul to the devil) will collapse under the sheer weight of the un- mastered complexity of their data processing systems. -- Edsger W. Dijkstra, SIGPLAN Notices, Volume 17, Number 5