[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 7/8] all: Clean up includes
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PATCH 7/8] all: Clean up includes |
Date: |
Thu, 18 Feb 2016 12:16:40 -0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 |
On 02/18/2016 11:05 AM, Peter Maydell wrote:
> Clean up includes so that osdep.h is included first and headers
> which it implies are not included manually.
>
> This commit was created with scripts/clean-includes.
>
> Signed-off-by: Peter Maydell <address@hidden>
> ---
> 56 files changed, 2 insertions(+), 100 deletions(-)
>
> +++ b/io/channel-util.c
> @@ -18,6 +18,7 @@
> *
> */
>
> +#include "qemu/osdep.h"
> #include "io/channel-util.h"
> #include "io/channel-file.h"
> #include "io/channel-socket.h"
Ah, so the 2 insertions are due to recent file additions, after your
last round of cleanups.
Any way to automate this into checkpatch.pl for new file creation? Then
again, not all developers have Coccinelle installed. But even checking
whether the string 'include.*qemu/osdep.h' is present in a new file may
help, even if it doesn't detect it being included out-of-order.
> +++ b/slirp/slirp.h
> @@ -1,11 +1,9 @@
> #ifndef __COMMON_H__
> #define __COMMON_H__
>
> -#include "config-host.h"
> #include "slirp_config.h"
>
> #ifdef _WIN32
> -# include <inttypes.h>
>
> typedef char *caddr_t;
>
> @@ -23,43 +21,31 @@ typedef char *caddr_t;
> # endif
> #endif
>
> -#include <sys/types.h>
> #ifdef HAVE_SYS_BITYPES_H
> # include <sys/bitypes.h>
> #endif
>
> -#include <sys/time.h>
>
> #ifdef HAVE_UNISTD_H
> -# include <unistd.h>
> #endif
>
> #ifdef HAVE_STDLIB_H
> -# include <stdlib.h>
> #endif
Leftover dead checks of HAVE_UNISTD_H and so forth; this file could use
further manual cleanups. For that matter, do we even need HAVE_UNISTD_H
in slirp/slirp_config.h any more? There's probably quite a bit of
pruning of cruft we could do. But as this patch was completely
automated, I'm fine if that cleanup is done as followups.
Therefore,
Reviewed-by: Eric Blake <address@hidden>
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
- [Qemu-devel] [PATCH 0/8] more include cleaning, Peter Maydell, 2016/02/18
- [Qemu-devel] [PATCH 7/8] all: Clean up includes, Peter Maydell, 2016/02/18
- Re: [Qemu-devel] [PATCH 7/8] all: Clean up includes,
Eric Blake <=
- [Qemu-devel] [PATCH 8/8] include: Clean up includes, Peter Maydell, 2016/02/18
- [Qemu-devel] [PATCH 2/8] osdep.h: Define macros for the benefit of C++ before C++11, Peter Maydell, 2016/02/18
- [Qemu-devel] [PATCH 6/8] osdep.h: Include config-target.h if NEED_CPU_H is defined, Peter Maydell, 2016/02/18
- [Qemu-devel] [PATCH 3/8] disas/arm-a64.cc: Include osdep.h first, Peter Maydell, 2016/02/18
- [Qemu-devel] [PATCH 4/8] scripts/clean-includes: Enhance to handle header files, Peter Maydell, 2016/02/18