From bc95be5dead68b7deba2fe121c3fbba4dc41bcdd Mon Sep 17 00:00:00 2001 From: Osier Yang Date: Tue, 16 Apr 2013 21:41:43 +0800 Subject: [PATCH] cleanup: Remove the duplicate header Detected by a simple Shell script: for i in $(git ls-files -- '*.[ch]'); do awk 'BEGIN { fail=0 } /# *include.*\.h/{ match($0, /["<][^">]*[">]/) arr[substr($0, RSTART+1, RLENGTH-2)]++ } END { for (key in arr) { if (arr[key] > 1) { fail=1 printf("%d %s\n", arr[key], key) } } if (fail == 1) exit 1 }' $i if test $? != 0; then echo "Duplicate header(s) in $i" fi done; A later patch will add the syntax-check to avoid duplicate headers. --- daemon/libvirtd.c | 1 - src/conf/node_device_conf.c | 1 - src/libxl/libxl_driver.c | 1 - src/network/bridge_driver.c | 1 - src/openvz/openvz_conf.c | 1 - src/openvz/openvz_driver.c | 1 - src/parallels/parallels_driver.c | 1 - src/phyp/phyp_driver.c | 1 - src/qemu/qemu_capabilities.h | 1 - src/qemu/qemu_driver.c | 1 - src/security/security_selinux.c | 1 - src/uml/uml_driver.c | 1 - src/util/virnetdevtap.c | 1 - src/xen/xen_hypervisor.c | 1 - 14 files changed, 14 deletions(-) diff --git a/daemon/libvirtd.c b/daemon/libvirtd.c index 34a8737669..38b7346698 100644 --- a/daemon/libvirtd.c +++ b/daemon/libvirtd.c @@ -51,7 +51,6 @@ #include "virnetlink.h" #include "virnetserver.h" #include "remote.h" -#include "remote_driver.h" #include "virhook.h" #include "viraudit.h" #include "locking/lock_manager.h" diff --git a/src/conf/node_device_conf.c b/src/conf/node_device_conf.c index b4d8cb3169..8fe4e0350d 100644 --- a/src/conf/node_device_conf.c +++ b/src/conf/node_device_conf.c @@ -31,7 +31,6 @@ #include "viralloc.h" #include "node_device_conf.h" -#include "viralloc.h" #include "virxml.h" #include "virutil.h" #include "virbuffer.h" diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c index 9980b38036..30541ce17c 100644 --- a/src/libxl/libxl_driver.c +++ b/src/libxl/libxl_driver.c @@ -39,7 +39,6 @@ #include "viralloc.h" #include "viruuid.h" #include "vircommand.h" -#include "libxl.h" #include "libxl_driver.h" #include "libxl_conf.h" #include "xen_xm.h" diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c index e8b314a891..3b279801f1 100644 --- a/src/network/bridge_driver.c +++ b/src/network/bridge_driver.c @@ -39,7 +39,6 @@ #include #include #include -#include #include #include #include diff --git a/src/openvz/openvz_conf.c b/src/openvz/openvz_conf.c index 4b21c4e301..a6f96c717f 100644 --- a/src/openvz/openvz_conf.c +++ b/src/openvz/openvz_conf.c @@ -36,7 +36,6 @@ #include #include #include -#include #include #include #include diff --git a/src/openvz/openvz_driver.c b/src/openvz/openvz_driver.c index 9b1062464b..5d22c63148 100644 --- a/src/openvz/openvz_driver.c +++ b/src/openvz/openvz_driver.c @@ -41,7 +41,6 @@ #include #include #include -#include #include #include "virerror.h" diff --git a/src/parallels/parallels_driver.c b/src/parallels/parallels_driver.c index 5b8d85fb7c..0c0bfcbb14 100644 --- a/src/parallels/parallels_driver.c +++ b/src/parallels/parallels_driver.c @@ -35,7 +35,6 @@ #include #include #include -#include #include #include #include diff --git a/src/phyp/phyp_driver.c b/src/phyp/phyp_driver.c index 50e8216805..3057345fbf 100644 --- a/src/phyp/phyp_driver.c +++ b/src/phyp/phyp_driver.c @@ -33,7 +33,6 @@ #include #include #include -#include #include #include #include diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h index 728add5620..4e76799343 100644 --- a/src/qemu/qemu_capabilities.h +++ b/src/qemu/qemu_capabilities.h @@ -27,7 +27,6 @@ # include "virobject.h" # include "capabilities.h" # include "vircommand.h" -# include "virobject.h" # include "qemu_monitor.h" /* Internal flags to keep track of qemu command line capabilities */ diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 7c167b7c65..cee5557d85 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -38,7 +38,6 @@ #include #include #include -#include #include #include #include diff --git a/src/security/security_selinux.c b/src/security/security_selinux.c index 7333a1fccb..c620a2ed25 100644 --- a/src/security/security_selinux.c +++ b/src/security/security_selinux.c @@ -43,7 +43,6 @@ #include "virfile.h" #include "virhash.h" #include "virrandom.h" -#include "virutil.h" #include "virconf.h" #include "virtpm.h" diff --git a/src/uml/uml_driver.c b/src/uml/uml_driver.c index 4fc2315cbb..498d1d9e30 100644 --- a/src/uml/uml_driver.c +++ b/src/uml/uml_driver.c @@ -38,7 +38,6 @@ #include #include #include -#include #include #include #include diff --git a/src/util/virnetdevtap.c b/src/util/virnetdevtap.c index 871376e51f..e4ce223657 100644 --- a/src/util/virnetdevtap.c +++ b/src/util/virnetdevtap.c @@ -29,7 +29,6 @@ #include "virnetdevopenvswitch.h" #include "virerror.h" #include "virfile.h" -#include "virerror.h" #include "viralloc.h" #include "virlog.h" #include "virutil.h" diff --git a/src/xen/xen_hypervisor.c b/src/xen/xen_hypervisor.c index e16fffe7e3..9dbbe0745b 100644 --- a/src/xen/xen_hypervisor.c +++ b/src/xen/xen_hypervisor.c @@ -33,7 +33,6 @@ #include #include #include -#include #include #include