qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: Anand J <anand.indukala@gmail.com>, qemu-devel@nongnu.org
Cc: qemu-trivial@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] clean-up: removed duplicate #includes
Date: Fri, 7 Oct 2016 09:31:44 -0500	[thread overview]
Message-ID: <290de67f-8505-fbd7-c2fa-6fbe7ca604eb@redhat.com> (raw)
In-Reply-To: <1475829975-17413-1-git-send-email-anand.indukala@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 2268 bytes --]

On 10/07/2016 03:46 AM, Anand J wrote:
> Some files contain multiple #includes of the same header file.
> Removed most of those unnecessary duplicate entries.

How did you find these? Is it a repeatable formula for rerunning a year
from now to find new culprits?  If so, listing it in the commit message
would be worthwhile.  Is it something we should add to
scripts/clean-includes?

> 
> Signed-off-by: Anand J <anand.indukala@gmail.com>
> ---

> +++ b/disas/libvixl/vixl/globals.h
> @@ -46,7 +46,6 @@
>  #include <assert.h>
>  #include <stdarg.h>
>  #include <stdio.h>
> -#include <stdint.h>
>  #include <stdlib.h>
>  #include <stddef.h>
>  #include "vixl/platform.h"

scripts/clean-includes intentionally ignores disas/libvixl because that
source is copied from elsewhere with minimal changes; are you sure this
hunk is appropriate?

> +++ b/hw/pci-bridge/pci_expander_bridge.c
> @@ -13,7 +13,6 @@
>  #include "qemu/osdep.h"
>  #include "qapi/error.h"
>  #include "hw/pci/pci.h"
> -#include "hw/pci/pci_bus.h"
>  #include "hw/pci/pci_host.h"
>  #include "hw/pci/pci_bus.h"

Changes like this are obviously correct...

>  #include "hw/pci/pci_bridge.h"
> diff --git a/hw/ppc/ppc405_boards.c b/hw/ppc/ppc405_boards.c
> index 4b2f07a..d01798f 100644
> --- a/hw/ppc/ppc405_boards.c
> +++ b/hw/ppc/ppc405_boards.c
> @@ -37,7 +37,6 @@
>  #include "qemu/log.h"
>  #include "qemu/error-report.h"
>  #include "hw/loader.h"
> -#include "sysemu/block-backend.h"
>  #include "sysemu/blockdev.h"
>  #include "exec/address-spaces.h"

...while changes like this require looking at context. But the nice part
of this patch is that if it compiles, it is correct...

> +++ b/hw/usb/dev-mtp.c
> @@ -17,7 +17,6 @@
>  #include <sys/statvfs.h>
>  #ifdef CONFIG_INOTIFY1
>  #include <sys/inotify.h>
> -#include "qapi/error.h"
>  #include "qemu/main-loop.h"
>  #endif

...well, ones like this are a little trickier (if CONFIG_INOTIFY1 is not
defined, a completed compilation is no indication of success - but
reading context shows it is correct, and the duplicate include was just
outside of the diff context).

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]

  reply	other threads:[~2016-10-07 14:31 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-07  8:46 [Qemu-devel] [PATCH] clean-up: removed duplicate #includes Anand J
2016-10-07 14:31 ` Eric Blake [this message]
2016-10-07 14:49   ` Peter Maydell
2016-10-08 11:32   ` Anand J
2016-10-08 21:34     ` Eric Blake
2016-10-09  9:33       ` Anand J
2016-10-10 16:25         ` Eric Blake
2016-10-07 14:48 ` Peter Maydell

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=290de67f-8505-fbd7-c2fa-6fbe7ca604eb@redhat.com \
    --to=eblake@redhat.com \
    --cc=anand.indukala@gmail.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-trivial@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).