* [Qemu-devel] [PATCH 1/2] script/clean-includes: added duplicate #include check
@ 2016-10-18 10:33 Anand J
2016-10-18 12:38 ` Anand J
0 siblings, 1 reply; 8+ messages in thread
From: Anand J @ 2016-10-18 10:33 UTC (permalink / raw)
To: qemu-devel
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 positive 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.
In order to enable the check use --check-duphead option with
script/clean-includes.
Signed-off-by: Anand J <anand.indukala@gmail.com>
---
scripts/clean-includes | 50 +++++++++++++++++++++++++++++++++++++-------------
1 file changed, 37 insertions(+), 13 deletions(-)
diff --git a/scripts/clean-includes b/scripts/clean-includes
index 4412a55..76dd0e4 100755
--- a/scripts/clean-includes
+++ b/scripts/clean-includes
@@ -14,15 +14,18 @@
# the top-level directory.
# Usage:
-# clean-includes [--git subjectprefix] file ...
+# clean-includes [--git subjectprefix] [--check-duphead] file ...
# or
-# clean-includes [--git subjectprefix] --all
+# clean-includes [--git subjectprefix] [--check-duphead] --all
#
# If the --git subjectprefix option is given, then after making
# the changes to the files this script will create a git commit
# with the subject line "subjectprefix: Clean up includes"
# and a boilerplate commit message.
#
+# If --check-duphead option is used, then check for duplicate
+# header files will be enabled.
+#
# Using --all will cause clean-includes to run on the whole source
# tree (excluding certain directories which are known not to need
# handling).
@@ -45,23 +48,36 @@
GIT=no
+DUPHEAD=no
# Extended regular expression defining files to ignore when using --all
XDIRREGEX='^(tests/tcg|tests/multiboot|pc-bios|disas/libvixl)'
-if [ $# -ne 0 ] && [ "$1" = "--git" ]; then
- if [ $# -eq 1 ]; then
- echo "--git option requires an argument"
- exit 1
- fi
- GITSUBJ="$2"
- GIT=yes
- shift
- shift
-fi
+while true
+do
+ case $1 in
+ "--git")
+ if [ $# -eq 1 ]; then
+ echo "--git option requires an argument"
+ exit 1
+ fi
+ GITSUBJ="$2"
+ GIT=yes
+ shift
+ shift
+ ;;
+ "--check-duphead")
+ DUPHEAD=yes
+ shift
+ ;;
+ *)
+ break
+ ;;
+ esac
+done
if [ $# -eq 0 ]; then
- echo "Usage: clean-includes [--git subjectprefix] [--all | foo.c ...]"
+ echo "Usage: clean-includes [--git subjectprefix] [--check-duphead] [--all | foo.c ...]"
echo "(modifies the files in place)"
exit 1
fi
@@ -154,6 +170,14 @@ for f in "$@"; do
done
+if [ "$DUPHEAD" = "yes" ]; then
+ grep "^#include" $@ | sort | uniq -c | awk '{if ($1 > 1) print $0}'
+ if [ $? -eq 0 ]; then
+ echo "Found duplicate header file includes. Please check the above files manually."
+ exit 1
+ fi
+fi
+
if [ "$GIT" = "yes" ]; then
git add -- "$@"
git commit --signoff -F - <<EOF
--
2.7.4
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [Qemu-devel] [PATCH 1/2] script/clean-includes: added duplicate #include check
2016-10-18 10:33 Anand J
@ 2016-10-18 12:38 ` Anand J
2016-10-20 9:08 ` Thomas Huth
0 siblings, 1 reply; 8+ messages in thread
From: Anand J @ 2016-10-18 12:38 UTC (permalink / raw)
To: qemu-devel; +Cc: thuth
On Tue, Oct 18, 2016 at 4:03 PM, Anand J <anand.indukala@gmail.com> 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 positive 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.
>
> In order to enable the check use --check-duphead option with
> script/clean-includes.
>
> Signed-off-by: Anand J <anand.indukala@gmail.com>
> ---
> scripts/clean-includes | 50 ++++++++++++++++++++++++++++++
> +++++++-------------
> 1 file changed, 37 insertions(+), 13 deletions(-)
>
> diff --git a/scripts/clean-includes b/scripts/clean-includes
> index 4412a55..76dd0e4 100755
> --- a/scripts/clean-includes
> +++ b/scripts/clean-includes
> @@ -14,15 +14,18 @@
> # the top-level directory.
>
> # Usage:
> -# clean-includes [--git subjectprefix] file ...
> +# clean-includes [--git subjectprefix] [--check-duphead] file ...
> # or
> -# clean-includes [--git subjectprefix] --all
> +# clean-includes [--git subjectprefix] [--check-duphead] --all
> #
> # If the --git subjectprefix option is given, then after making
> # the changes to the files this script will create a git commit
> # with the subject line "subjectprefix: Clean up includes"
> # and a boilerplate commit message.
> #
> +# If --check-duphead option is used, then check for duplicate
> +# header files will be enabled.
> +#
> # Using --all will cause clean-includes to run on the whole source
> # tree (excluding certain directories which are known not to need
> # handling).
> @@ -45,23 +48,36 @@
>
>
> GIT=no
> +DUPHEAD=no
>
> # Extended regular expression defining files to ignore when using --all
> XDIRREGEX='^(tests/tcg|tests/multiboot|pc-bios|disas/libvixl)'
>
> -if [ $# -ne 0 ] && [ "$1" = "--git" ]; then
> - if [ $# -eq 1 ]; then
> - echo "--git option requires an argument"
> - exit 1
> - fi
> - GITSUBJ="$2"
> - GIT=yes
> - shift
> - shift
> -fi
> +while true
> +do
> + case $1 in
> + "--git")
> + if [ $# -eq 1 ]; then
> + echo "--git option requires an argument"
> + exit 1
> + fi
> + GITSUBJ="$2"
> + GIT=yes
> + shift
> + shift
> + ;;
> + "--check-duphead")
> + DUPHEAD=yes
> + shift
> + ;;
> + *)
> + break
> + ;;
> + esac
> +done
>
> if [ $# -eq 0 ]; then
> - echo "Usage: clean-includes [--git subjectprefix] [--all | foo.c ...]"
> + echo "Usage: clean-includes [--git subjectprefix] [--check-duphead]
> [--all | foo.c ...]"
> echo "(modifies the files in place)"
> exit 1
> fi
> @@ -154,6 +170,14 @@ for f in "$@"; do
>
> done
>
> +if [ "$DUPHEAD" = "yes" ]; then
> + grep "^#include" $@ | sort | uniq -c | awk '{if ($1 > 1) print $0}'
> + if [ $? -eq 0 ]; then
> + echo "Found duplicate header file includes. Please check the
> above files manually."
> + exit 1
> + fi
> +fi
> +
> if [ "$GIT" = "yes" ]; then
> git add -- "$@"
> git commit --signoff -F - <<EOF
> --
> 2.7.4
>
>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Qemu-devel] [PATCH 1/2] script/clean-includes: added duplicate #include check
2016-10-18 12:38 ` Anand J
@ 2016-10-20 9:08 ` Thomas Huth
2016-10-20 9:56 ` Anand J
0 siblings, 1 reply; 8+ messages in thread
From: Thomas Huth @ 2016-10-20 9:08 UTC (permalink / raw)
To: Anand J, qemu-devel
On 18.10.2016 14:38, Anand J wrote:
>
>
> On Tue, Oct 18, 2016 at 4:03 PM, Anand J <anand.indukala@gmail.com
> <mailto:anand.indukala@gmail.com>> 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 positive 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.
>
> In order to enable the check use --check-duphead option with
> script/clean-includes.
>
> Signed-off-by: Anand J <anand.indukala@gmail.com
> <mailto:anand.indukala@gmail.com>>
> ---
> scripts/clean-includes | 50
> +++++++++++++++++++++++++++++++++++++-------------
> 1 file changed, 37 insertions(+), 13 deletions(-)
Thanks for the update, this patch looks fine to me now, so feel free to
add my:
Reviewed-by: Thomas Huth <thuth@redhat.com>
But please avoid sending patches in HTML e-mails. Could you maybe please
resend the patch as plain text mail? And while you're at it, add CC: to
qemu-trivial@nongnu.org, I think the patch is simple enough to go
through the trivial tree.
Thanks,
Thomas
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Qemu-devel] [PATCH 1/2] script/clean-includes: added duplicate #include check
@ 2016-10-20 9:52 Anand J
2016-10-20 9:52 ` [Qemu-devel] [PATCH 2/2] clean-up: removed duplicate #includes Anand J
` (2 more replies)
0 siblings, 3 replies; 8+ messages in thread
From: Anand J @ 2016-10-20 9:52 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-trivial, thuth
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 positive 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.
In order to enable the check use --check-duphead option with
script/clean-includes.
Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Anand J <anand.indukala@gmail.com>
---
scripts/clean-includes | 50 +++++++++++++++++++++++++++++++++++++-------------
1 file changed, 37 insertions(+), 13 deletions(-)
diff --git a/scripts/clean-includes b/scripts/clean-includes
index 4412a55..76dd0e4 100755
--- a/scripts/clean-includes
+++ b/scripts/clean-includes
@@ -14,15 +14,18 @@
# the top-level directory.
# Usage:
-# clean-includes [--git subjectprefix] file ...
+# clean-includes [--git subjectprefix] [--check-duphead] file ...
# or
-# clean-includes [--git subjectprefix] --all
+# clean-includes [--git subjectprefix] [--check-duphead] --all
#
# If the --git subjectprefix option is given, then after making
# the changes to the files this script will create a git commit
# with the subject line "subjectprefix: Clean up includes"
# and a boilerplate commit message.
#
+# If --check-duphead option is used, then check for duplicate
+# header files will be enabled.
+#
# Using --all will cause clean-includes to run on the whole source
# tree (excluding certain directories which are known not to need
# handling).
@@ -45,23 +48,36 @@
GIT=no
+DUPHEAD=no
# Extended regular expression defining files to ignore when using --all
XDIRREGEX='^(tests/tcg|tests/multiboot|pc-bios|disas/libvixl)'
-if [ $# -ne 0 ] && [ "$1" = "--git" ]; then
- if [ $# -eq 1 ]; then
- echo "--git option requires an argument"
- exit 1
- fi
- GITSUBJ="$2"
- GIT=yes
- shift
- shift
-fi
+while true
+do
+ case $1 in
+ "--git")
+ if [ $# -eq 1 ]; then
+ echo "--git option requires an argument"
+ exit 1
+ fi
+ GITSUBJ="$2"
+ GIT=yes
+ shift
+ shift
+ ;;
+ "--check-duphead")
+ DUPHEAD=yes
+ shift
+ ;;
+ *)
+ break
+ ;;
+ esac
+done
if [ $# -eq 0 ]; then
- echo "Usage: clean-includes [--git subjectprefix] [--all | foo.c ...]"
+ echo "Usage: clean-includes [--git subjectprefix] [--check-duphead] [--all | foo.c ...]"
echo "(modifies the files in place)"
exit 1
fi
@@ -154,6 +170,14 @@ for f in "$@"; do
done
+if [ "$DUPHEAD" = "yes" ]; then
+ grep "^#include" $@ | sort | uniq -c | awk '{if ($1 > 1) print $0}'
+ if [ $? -eq 0 ]; then
+ echo "Found duplicate header file includes. Please check the above files manually."
+ exit 1
+ fi
+fi
+
if [ "$GIT" = "yes" ]; then
git add -- "$@"
git commit --signoff -F - <<EOF
--
2.7.4
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [Qemu-devel] [PATCH 2/2] clean-up: removed duplicate #includes
2016-10-20 9:52 [Qemu-devel] [PATCH 1/2] script/clean-includes: added duplicate #include check Anand J
@ 2016-10-20 9:52 ` Anand J
2016-10-20 13:48 ` [Qemu-devel] [PATCH 1/2] script/clean-includes: added duplicate #include check Eric Blake
2016-10-20 13:57 ` Eric Blake
2 siblings, 0 replies; 8+ messages in thread
From: Anand J @ 2016-10-20 9:52 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-trivial, thuth
Some files contain multiple #includes of the same header file.
Removed most of those unnecessary duplicate entries using
scripts/clean-includes.
Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Anand J <anand.indukala@gmail.com>
---
accel.c | 1 -
cputlb.c | 1 -
gdbstub.c | 1 -
hw/i386/acpi-build.c | 1 -
hw/microblaze/boot.c | 1 -
hw/mips/mips_malta.c | 1 -
hw/nvram/fw_cfg.c | 1 -
hw/pci-bridge/pci_expander_bridge.c | 1 -
hw/ppc/ppc405_boards.c | 1 -
hw/ppc/spapr.c | 1 -
hw/timer/grlib_gptimer.c | 1 -
hw/tpm/tpm_tis.c | 1 -
hw/unicore32/puv3.c | 1 -
hw/usb/dev-mtp.c | 1 -
include/hw/i386/pc.h | 1 -
monitor.c | 2 --
qemu-io-cmds.c | 1 -
qmp.c | 1 -
target-i386/machine.c | 3 ---
target-mips/machine.c | 1 -
target-ppc/machine.c | 1 -
target-ppc/mem_helper.c | 1 -
target-sparc/machine.c | 3 ---
target-xtensa/translate.c | 1 -
tests/crypto-tls-x509-helpers.h | 3 ---
tests/vhost-user-test.c | 2 --
util/oslib-posix.c | 1 -
vl.c | 1 -
28 files changed, 36 deletions(-)
diff --git a/accel.c b/accel.c
index 403eb5e..664bb88 100644
--- a/accel.c
+++ b/accel.c
@@ -33,7 +33,6 @@
#include "sysemu/qtest.h"
#include "hw/xen/xen.h"
#include "qom/object.h"
-#include "hw/boards.h"
int tcg_tb_size;
static bool tcg_allowed = true;
diff --git a/cputlb.c b/cputlb.c
index 3c99c34..6a7208f 100644
--- a/cputlb.c
+++ b/cputlb.c
@@ -28,7 +28,6 @@
#include "exec/memory-internal.h"
#include "exec/ram_addr.h"
-#include "exec/exec-all.h"
#include "tcg/tcg.h"
#include "qemu/error-report.h"
#include "exec/log.h"
diff --git a/gdbstub.c b/gdbstub.c
index ecea8c4..67eb028 100644
--- a/gdbstub.c
+++ b/gdbstub.c
@@ -31,7 +31,6 @@
#define MAX_PACKET_LENGTH 4096
-#include "cpu.h"
#include "qemu/sockets.h"
#include "sysemu/kvm.h"
#include "exec/semihost.h"
diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
index e999654..2b49f58 100644
--- a/hw/i386/acpi-build.c
+++ b/hw/i386/acpi-build.c
@@ -53,7 +53,6 @@
#include "hw/pci/pci_bus.h"
#include "hw/pci-host/q35.h"
#include "hw/i386/x86-iommu.h"
-#include "hw/timer/hpet.h"
#include "hw/acpi/aml-build.h"
diff --git a/hw/microblaze/boot.c b/hw/microblaze/boot.c
index 9eebb1a..1834d22 100644
--- a/hw/microblaze/boot.c
+++ b/hw/microblaze/boot.c
@@ -30,7 +30,6 @@
#include "qemu/option.h"
#include "qemu/config-file.h"
#include "qemu/error-report.h"
-#include "qemu-common.h"
#include "sysemu/device_tree.h"
#include "sysemu/sysemu.h"
#include "hw/loader.h"
diff --git a/hw/mips/mips_malta.c b/hw/mips/mips_malta.c
index e90857e..61aa8eb 100644
--- a/hw/mips/mips_malta.c
+++ b/hw/mips/mips_malta.c
@@ -47,7 +47,6 @@
#include "elf.h"
#include "hw/timer/mc146818rtc.h"
#include "hw/timer/i8254.h"
-#include "sysemu/block-backend.h"
#include "sysemu/blockdev.h"
#include "exec/address-spaces.h"
#include "hw/sysbus.h" /* SysBusDevice */
diff --git a/hw/nvram/fw_cfg.c b/hw/nvram/fw_cfg.c
index 92aa563..1f0c3e9 100644
--- a/hw/nvram/fw_cfg.c
+++ b/hw/nvram/fw_cfg.c
@@ -29,7 +29,6 @@
#include "hw/isa/isa.h"
#include "hw/nvram/fw_cfg.h"
#include "hw/sysbus.h"
-#include "hw/boards.h"
#include "trace.h"
#include "qemu/error-report.h"
#include "qemu/config-file.h"
diff --git a/hw/pci-bridge/pci_expander_bridge.c b/hw/pci-bridge/pci_expander_bridge.c
index 1cc598f..6ac187f 100644
--- a/hw/pci-bridge/pci_expander_bridge.c
+++ b/hw/pci-bridge/pci_expander_bridge.c
@@ -15,7 +15,6 @@
#include "hw/pci/pci.h"
#include "hw/pci/pci_bus.h"
#include "hw/pci/pci_host.h"
-#include "hw/pci/pci_bus.h"
#include "hw/pci/pci_bridge.h"
#include "hw/i386/pc.h"
#include "qemu/range.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"
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index ddb7438..2491287 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -37,7 +37,6 @@
#include "sysemu/block-backend.h"
#include "sysemu/cpus.h"
#include "sysemu/kvm.h"
-#include "sysemu/device_tree.h"
#include "kvm_ppc.h"
#include "migration/migration.h"
#include "mmu-hash64.h"
diff --git a/hw/timer/grlib_gptimer.c b/hw/timer/grlib_gptimer.c
index 712d1ae..4ed96e9 100644
--- a/hw/timer/grlib_gptimer.c
+++ b/hw/timer/grlib_gptimer.c
@@ -26,7 +26,6 @@
#include "hw/sysbus.h"
#include "qemu/timer.h"
#include "hw/ptimer.h"
-#include "qemu/timer.h"
#include "qemu/main-loop.h"
#include "trace.h"
diff --git a/hw/tpm/tpm_tis.c b/hw/tpm/tpm_tis.c
index 381e726..a6440fe 100644
--- a/hw/tpm/tpm_tis.c
+++ b/hw/tpm/tpm_tis.c
@@ -34,7 +34,6 @@
#include "qapi/error.h"
#include "qemu-common.h"
#include "qemu/main-loop.h"
-#include "sysemu/tpm_backend.h"
#define DEBUG_TIS 0
diff --git a/hw/unicore32/puv3.c b/hw/unicore32/puv3.c
index 31cd171..032078f 100644
--- a/hw/unicore32/puv3.c
+++ b/hw/unicore32/puv3.c
@@ -13,7 +13,6 @@
#include "qapi/error.h"
#include "qemu-common.h"
#include "cpu.h"
-#include "qemu-common.h"
#include "ui/console.h"
#include "elf.h"
#include "exec/address-spaces.h"
diff --git a/hw/usb/dev-mtp.c b/hw/usb/dev-mtp.c
index 58d95ff..9cb0f50 100644
--- a/hw/usb/dev-mtp.c
+++ 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
diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h
index b16c448..9c42603 100644
--- a/include/hw/i386/pc.h
+++ b/include/hw/i386/pc.h
@@ -13,7 +13,6 @@
#include "qemu/bitmap.h"
#include "sysemu/sysemu.h"
#include "hw/pci/pci.h"
-#include "hw/boards.h"
#include "hw/compat.h"
#include "hw/mem/pc-dimm.h"
#include "hw/mem/nvdimm.h"
diff --git a/monitor.c b/monitor.c
index 8728dd9..b8773a5 100644
--- a/monitor.c
+++ b/monitor.c
@@ -59,7 +59,6 @@
#include "qapi/qmp/json-streamer.h"
#include "qapi/qmp/json-parser.h"
#include "qom/object_interfaces.h"
-#include "cpu.h"
#include "trace.h"
#include "trace/control.h"
#include "monitor/hmp-target.h"
@@ -76,7 +75,6 @@
#include "qapi/qmp-event.h"
#include "qapi-event.h"
#include "qmp-introspect.h"
-#include "sysemu/block-backend.h"
#include "sysemu/qtest.h"
#include "qemu/cutils.h"
#include "qapi/qmp/dispatch.h"
diff --git a/qemu-io-cmds.c b/qemu-io-cmds.c
index 3a3838a..e0249e2 100644
--- a/qemu-io-cmds.c
+++ b/qemu-io-cmds.c
@@ -18,7 +18,6 @@
#include "qemu/error-report.h"
#include "qemu/main-loop.h"
#include "qemu/timer.h"
-#include "sysemu/block-backend.h"
#include "qemu/cutils.h"
#define CMD_NOFILE_OK 0x01
diff --git a/qmp.c b/qmp.c
index b3ba9ef..f37ad7e 100644
--- a/qmp.c
+++ b/qmp.c
@@ -36,7 +36,6 @@
#include "qom/object_interfaces.h"
#include "hw/mem/pc-dimm.h"
#include "hw/acpi/acpi_dev_interface.h"
-#include "qemu/uuid.h"
NameInfo *qmp_query_name(Error **errp)
{
diff --git a/target-i386/machine.c b/target-i386/machine.c
index 71c0e4d..48037f1 100644
--- a/target-i386/machine.c
+++ b/target-i386/machine.c
@@ -7,10 +7,7 @@
#include "hw/i386/pc.h"
#include "hw/isa/isa.h"
#include "migration/cpu.h"
-#include "exec/exec-all.h"
-#include "cpu.h"
-#include "exec/exec-all.h"
#include "sysemu/kvm.h"
#include "qemu/error-report.h"
diff --git a/target-mips/machine.c b/target-mips/machine.c
index a27f2f1..d20d948 100644
--- a/target-mips/machine.c
+++ b/target-mips/machine.c
@@ -2,7 +2,6 @@
#include "qemu-common.h"
#include "cpu.h"
#include "hw/hw.h"
-#include "cpu.h"
#include "migration/cpu.h"
static int cpu_post_load(void *opaque, int version_id)
diff --git a/target-ppc/machine.c b/target-ppc/machine.c
index 4820f22..e43cb6c 100644
--- a/target-ppc/machine.c
+++ b/target-ppc/machine.c
@@ -8,7 +8,6 @@
#include "helper_regs.h"
#include "mmu-hash64.h"
#include "migration/cpu.h"
-#include "exec/exec-all.h"
static int cpu_load_old(QEMUFile *f, void *opaque, int version_id)
{
diff --git a/target-ppc/mem_helper.c b/target-ppc/mem_helper.c
index 6548715..1ab8a6e 100644
--- a/target-ppc/mem_helper.c
+++ b/target-ppc/mem_helper.c
@@ -23,7 +23,6 @@
#include "exec/helper-proto.h"
#include "helper_regs.h"
-#include "exec/exec-all.h"
#include "exec/cpu_ldst.h"
//#define DEBUG_OP
diff --git a/target-sparc/machine.c b/target-sparc/machine.c
index 59c92f7..aea6397 100644
--- a/target-sparc/machine.c
+++ b/target-sparc/machine.c
@@ -6,10 +6,7 @@
#include "hw/boards.h"
#include "qemu/timer.h"
-#include "cpu.h"
-#include "exec/exec-all.h"
#include "migration/cpu.h"
-#include "exec/exec-all.h"
#ifdef TARGET_SPARC64
static const VMStateDescription vmstate_cpu_timer = {
diff --git a/target-xtensa/translate.c b/target-xtensa/translate.c
index 4c1e487..fb0fa56 100644
--- a/target-xtensa/translate.c
+++ b/target-xtensa/translate.c
@@ -36,7 +36,6 @@
#include "tcg-op.h"
#include "qemu/log.h"
#include "sysemu/sysemu.h"
-#include "exec/exec-all.h"
#include "exec/cpu_ldst.h"
#include "exec/semihost.h"
diff --git a/tests/crypto-tls-x509-helpers.h b/tests/crypto-tls-x509-helpers.h
index a8faa92..921341c 100644
--- a/tests/crypto-tls-x509-helpers.h
+++ b/tests/crypto-tls-x509-helpers.h
@@ -21,9 +21,6 @@
#include <gnutls/gnutls.h>
#include <gnutls/x509.h>
-#include <gnutls/gnutls.h>
-#include <gnutls/x509.h>
-
#if !(defined WIN32) && \
defined(CONFIG_TASN1) && \
(LIBGNUTLS_VERSION_NUMBER >= 0x020600)
diff --git a/tests/vhost-user-test.c b/tests/vhost-user-test.c
index d7c48c5..4d85f88 100644
--- a/tests/vhost-user-test.c
+++ b/tests/vhost-user-test.c
@@ -20,8 +20,6 @@
#include "libqos/pci-pc.h"
#include "libqos/virtio-pci.h"
-#include "libqos/pci-pc.h"
-#include "libqos/virtio-pci.h"
#include "libqos/malloc-pc.h"
#include "hw/virtio/virtio-net.h"
diff --git a/util/oslib-posix.c b/util/oslib-posix.c
index 8ec99cc..67c6589 100644
--- a/util/oslib-posix.c
+++ b/util/oslib-posix.c
@@ -28,7 +28,6 @@
#include "qemu/osdep.h"
#include <termios.h>
-#include <termios.h>
#include <glib/gprintf.h>
diff --git a/vl.c b/vl.c
index ebd47af..8d0c7c3 100644
--- a/vl.c
+++ b/vl.c
@@ -110,7 +110,6 @@ int main(int argc, char **argv)
#include "trace.h"
#include "trace/control.h"
#include "qemu/queue.h"
-#include "sysemu/cpus.h"
#include "sysemu/arch_init.h"
#include "ui/qemu-spice.h"
--
2.7.4
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [Qemu-devel] [PATCH 1/2] script/clean-includes: added duplicate #include check
2016-10-20 9:08 ` Thomas Huth
@ 2016-10-20 9:56 ` Anand J
0 siblings, 0 replies; 8+ messages in thread
From: Anand J @ 2016-10-20 9:56 UTC (permalink / raw)
To: Thomas Huth; +Cc: qemu-devel
send a new patch. please check http://patchwork.ozlabs.org/patch/684533/
Thanks,
Anand
On Thu, Oct 20, 2016 at 2:38 PM, Thomas Huth <thuth@redhat.com> wrote:
> On 18.10.2016 14:38, Anand J wrote:
> >
> >
> > On Tue, Oct 18, 2016 at 4:03 PM, Anand J <anand.indukala@gmail.com
> > <mailto:anand.indukala@gmail.com>> 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 positive 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.
> >
> > In order to enable the check use --check-duphead option with
> > script/clean-includes.
> >
> > Signed-off-by: Anand J <anand.indukala@gmail.com
> > <mailto:anand.indukala@gmail.com>>
> > ---
> > scripts/clean-includes | 50
> > +++++++++++++++++++++++++++++++++++++-------------
> > 1 file changed, 37 insertions(+), 13 deletions(-)
>
> Thanks for the update, this patch looks fine to me now, so feel free to
> add my:
>
> Reviewed-by: Thomas Huth <thuth@redhat.com>
>
> But please avoid sending patches in HTML e-mails. Could you maybe please
> resend the patch as plain text mail? And while you're at it, add CC: to
> qemu-trivial@nongnu.org, I think the patch is simple enough to go
> through the trivial tree.
>
> Thanks,
> Thomas
>
>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Qemu-devel] [PATCH 1/2] script/clean-includes: added duplicate #include check
2016-10-20 9:52 [Qemu-devel] [PATCH 1/2] script/clean-includes: added duplicate #include check Anand J
2016-10-20 9:52 ` [Qemu-devel] [PATCH 2/2] clean-up: removed duplicate #includes Anand J
@ 2016-10-20 13:48 ` Eric Blake
2016-10-20 13:57 ` Eric Blake
2 siblings, 0 replies; 8+ messages in thread
From: Eric Blake @ 2016-10-20 13:48 UTC (permalink / raw)
To: Anand J, qemu-devel; +Cc: qemu-trivial, thuth
[-- Attachment #1: Type: text/plain, Size: 1413 bytes --]
[meta-comment]
On 10/20/2016 04:52 AM, 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.
This appears to be a v2 patch. But it is missing a 0/2 cover letter,
and mention of v2 in the subject line. 'git format-patch --cover-letter
-v2' will do what you want (as well as git send-email, which understands
all options accepted by format-patch); it's also possible to automate
git to send a cover letter any time you send more than one patch by
using 'git config format.coverLetter auto'.
More patch submission tips at http://wiki.qemu.org/Contribute/SubmitAPatch
>
> Script might output false positive 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.
>
> In order to enable the check use --check-duphead option with
> script/clean-includes.
>
> Reviewed-by: Thomas Huth <thuth@redhat.com>
> Signed-off-by: Anand J <anand.indukala@gmail.com>
> ---
> scripts/clean-includes | 50 +++++++++++++++++++++++++++++++++++++-------------
> 1 file changed, 37 insertions(+), 13 deletions(-)
>
--
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 --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Qemu-devel] [PATCH 1/2] script/clean-includes: added duplicate #include check
2016-10-20 9:52 [Qemu-devel] [PATCH 1/2] script/clean-includes: added duplicate #include check Anand J
2016-10-20 9:52 ` [Qemu-devel] [PATCH 2/2] clean-up: removed duplicate #includes Anand J
2016-10-20 13:48 ` [Qemu-devel] [PATCH 1/2] script/clean-includes: added duplicate #include check Eric Blake
@ 2016-10-20 13:57 ` Eric Blake
2 siblings, 0 replies; 8+ messages in thread
From: Eric Blake @ 2016-10-20 13:57 UTC (permalink / raw)
To: Anand J, qemu-devel; +Cc: qemu-trivial, thuth
[-- Attachment #1: Type: text/plain, Size: 2142 bytes --]
On 10/20/2016 04:52 AM, 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.
Subject line typo: s,script/,scripts/,
>
> Script might output false positive 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.
>
> In order to enable the check use --check-duphead option with
> script/clean-includes.
Bike-shedding, but if you are going to put a dash between words, put it
between ALL words, as in --check-dup-head. Or spell it out:
--check-duplicate-headers. If that feels to long, and you want to
abbreviate, then abbreviate further, as in --duphead.
>
> Reviewed-by: Thomas Huth <thuth@redhat.com>
> Signed-off-by: Anand J <anand.indukala@gmail.com>
> ---
> #
> +# If --check-duphead option is used, then check for duplicate
> +# header files will be enabled.
Grammar; I suggest:
If --check-duphead is specified, additionally check for duplicate header
includes.
> +while true
> +do
> + case $1 in
> + "--git")
> + if [ $# -eq 1 ]; then
> + echo "--git option requires an argument"
> + exit 1
> + fi
> + GITSUBJ="$2"
> + GIT=yes
> + shift
> + shift
> + ;;
> + "--check-duphead")
> + DUPHEAD=yes
> + shift
> + ;;
> + *)
Your option-parsing loop is missing a special case for --; for
consistency with POSIX recommendations, you should have:
--)
shift
break
;;
*)
as a way to end option parsing early (and force the next argument to be
treated as a filename, even if it starts with -).
>
> +if [ "$DUPHEAD" = "yes" ]; then
> + grep "^#include" $@ | sort | uniq -c | awk '{if ($1 > 1) print $0}'
Missing quotes around $@.
Looking forward to v3.
--
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 --]
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2016-10-20 13:57 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-10-20 9:52 [Qemu-devel] [PATCH 1/2] script/clean-includes: added duplicate #include check Anand J
2016-10-20 9:52 ` [Qemu-devel] [PATCH 2/2] clean-up: removed duplicate #includes Anand J
2016-10-20 13:48 ` [Qemu-devel] [PATCH 1/2] script/clean-includes: added duplicate #include check Eric Blake
2016-10-20 13:57 ` Eric Blake
-- strict thread matches above, loose matches on Subject: below --
2016-10-18 10:33 Anand J
2016-10-18 12:38 ` Anand J
2016-10-20 9:08 ` Thomas Huth
2016-10-20 9:56 ` Anand J
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).