[U-Boot] [PATCH V2] i.MX28: Drop __naked function from spl_mem_init

Stefano Babic sbabic at denx.de
Tue Mar 20 10:17:13 CET 2012

On 20/03/2012 09:39, Wolfgang Denk wrote:
> Dear Stefano,

Hi Wolfgang,

> 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.

Yes, I understand your point - and generally I agree with you . Only
this special case let me think if the compiler is always right...

> 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.

Well, but you should admit that if the comment is really an assembly
line and the next line itself is written directly in machine code, it is
quite normal to have doubts why we need a compiler and / or an assembler...

> 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?

The current fix is at the moment an exception - personally I am aware of
it and I can live with it.

I wanted simply to raise a question about this odd case, when we are
sometimes constrained by the compiler to do very strange things...

Best regards,
Stefano Babic

DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80  Email: office at denx.de

More information about the U-Boot mailing list