[U-Boot] [PATCH 03/11] arm: tegra: mmc: clean-up include file order

Marcel Ziswiler marcel at ziswiler.com
Wed Aug 19 18:00:25 CEST 2015



On 18 August 2015 14:44:01 CEST, Simon Glass <sjg at chromium.org> wrote:

>No I think you misunderstand. Another way of explaining this is
>sorting fruit and animals:
>
>apple
>grapefruit
>orange
>elephant
>lion
>zebra
>
>We don't want to mix up the fruit and animals, so each has its own
>position in the table.We can then easily see what animals are in the
>table.

I see but I still don't think your example matches our problem at hand quite that accurately.

>This is not a case of running 'sort' on the includes. The 'asm' files
>are arch-specific includes and should go after all the 'generic'
>includes, like <bbb.c>, etc.
>
>So to repeat, the ordering should be:
>
><common.h>       <- most general
><others.h>
><asm/...>
><arch/arm/...>
><linux/...>
>"local.h"               <- least general

Your proposal sounds quite honourable but the problem I see with it is that your order is based on some generality rule I don't quite see where it could be looked up.

At the end I believe the order actually does not even matter apart from U-Boot's special common.h having to go first. And even that could be worked around by the build system itself (see e.g. Linux kernel for that matter).

So for me such ordering is just cosmetic and might at best help us humble programmers when comparing stuff or looking through to make sure a certain include is indeed already there or the like.

The only practical way I see to achieve this would be to plain simply alphabetically sort them.

As I don't think this is much worth discussing any further I'm fine with dropping this patch even though I actually think the actual file in question is seriously buggy as it does not put common.h first.


More information about the U-Boot mailing list