[U-Boot] [RFC PATCH] ARM: S3C64XX: add support for mini6410

Albert ARIBAUD albert.aribaud at free.fr
Wed Dec 1 07:42:00 CET 2010


Hi Darius,

Le 30/11/2010 10:19, Darius Augulis a écrit :

> I understand, that there is such rule in u-boot, but it's ... at least strange.
> Even linux kernel doesn't use such approach and uses simple defines instead.
> One big disadvantage for already existing platforms - one must convert
> all defines to C structure.

These rules apply to new code; existing code can just remain the same, 
precisely to avoid rewrites.

> Remove almost everything from header file, because no need to have
> duplicated code.

?

> And what about code porting between linux kernel and u-boot? With
> definitions in header file it's easy copy paste procedure.

There are exceptions for code ported from Linux, IIRC.

> What if I need two registers separated with big gap from one big 100
> register bank? Then I need to build huge C structure with many dummy
> variables.

That's only one dummy variable, an array of 100 elements. Plus it 
*shows* there is a gap, which when dealing with datasheets is a plus.

> Lot of lines... In this case, possibility to make a dummy
> error is bigger. IMHO C structure for register definition is not
> better than definitions in header file. It's worse.
> We could have much tiny, simply and more readable code with definition
> in header file. And this approach has been used for years and still
> used in linux kernel. Perhaps, not without reason...

One of the interests of C structs is that they guarantee against errors 
in typing register offsets, for instance.

> If u-boot maintainers are really going not accept this patch because
> of this, I will change it. But it's meaningless and very annoying.

Please bear with it, just like we all bear with e.g. coding style rules 
from checkpatch.pl even though we would personally do it another way.

> thanks,
> Darius

Amicalement,
-- 
Albert.


More information about the U-Boot mailing list