qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Huth <thuth@redhat.com>
To: Anand J <anand.indukala@gmail.com>,
	qemu-devel@nongnu.org, Markus Armbruster <armbru@redhat.com>
Subject: Re: [Qemu-devel] [PATCH] script/clean-includes: added duplicate #include check
Date: Tue, 18 Oct 2016 10:21:10 +0200	[thread overview]
Message-ID: <19f28997-b381-002b-256c-6eef3f17183a@redhat.com> (raw)
In-Reply-To: <1476297600-27453-1-git-send-email-anand.indukala@gmail.com>

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

 Thomas

      parent reply	other threads:[~2016-10-18  8:21 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-12 18:40 [Qemu-devel] [PATCH] script/clean-includes: added duplicate #include check Anand J
2016-10-18  8:00 ` Anand J
2016-10-18  8:21 ` Thomas Huth [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=19f28997-b381-002b-256c-6eef3f17183a@redhat.com \
    --to=thuth@redhat.com \
    --cc=anand.indukala@gmail.com \
    --cc=armbru@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).