Hi Simon,


>> BTW, the "Include file order" in
>> http://www.denx.de/wiki/U-Boot/CodingStyle
>>
>> Is this your opinion? Or community's opinion.
>>
>> Did anybody review it?
>
> This came from Mike Frysinger some years ago on the mailing list and I
> have followed it since. I took it to be a U-Boot standard and added it
> to the Wiki at some point. Linux perhaps has linux/ above asm/ for its
> own reasons (e.g. because it is Linux and needs its headers first) but
> I don't think that is a good idea for U-Boot. It is unnecessary and
> makes the sort order more confusing.
>

OK, but I want to know the reason.
Do you remember why Mike Frysinger suggested so?

I guess Linux sorts headers from global to local.

#include <linux/*.h>    global in the project
#include <asm/*.h>      arch-specific
#include "foo.h"        local in the directory


Likewise, the following makes sense for U-Boot

#include <common.h>
#include <*.h>              global in the project (U-boot orignal)
#include <linux/*.h>        global in the project (come from Linux)
#include <asm/*.h>          arch-specific
#include <asm/arch/*.h>     SoC-specific
#include "foo.h"            local in the directory

if I am not missing something...


-- 
Best Regards
Masahiro Yamada
_______________________________________________
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

Reply via email to