On 12.10.2016 20:40, Anand J wrote:
> Added script to check duplicate #include entries. This check will scan and
> print the files in which duplicate #include entries are present.
> Script might output false postive entries as well. Such entries should
> not be removed. So if it finds any duplicate entries script will terminate
> with an exit status 1. Then each and every file should be checked manually
> and corrected if necessary.
> Added an additional option --ignore-duphead in the clean-includes
> script to disable this check if all the duplicate #includes are
> genuine. The check in enabled by default.
Hmm, maybe it would be better to do it the other way round? Do not check
this by default since there are files that need to include a header
twice, and add a "--check-duphead" option to enable this check?
> NOTE: Removed some of the genuine duplicate entries in the code base.
Could you please split this patch into two parts? One patch that changes
the clean-includes script, and one that removes the superfluous
"#include" statements? That would help to make this patch more reviewable...
> diff --git a/accel.c b/accel.c
> index 403eb5e..b5a4210 100644
> --- a/accel.c
> +++ b/accel.c
> @@ -25,7 +25,6 @@
> #include "qemu/osdep.h"
> #include "sysemu/accel.h"
> -#include "hw/boards.h"
> #include "qemu-common.h"
> #include "sysemu/arch_init.h"
> #include "sysemu/sysemu.h"
Since the include order still matters in some files, I think it would be
better if you'd always remove the second include statement, not the