qemu-trivial
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-trivial] [Qemu-devel] [PATCH] clean-up: removed duplicate #inc


From: Eric Blake
Subject: Re: [Qemu-trivial] [Qemu-devel] [PATCH] clean-up: removed duplicate #includes
Date: Fri, 7 Oct 2016 09:31:44 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0

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 <address@hidden>
> ---

> +++ 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: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]