From d8e39b70625d4ba1e998439d1a077b4b978930e7 Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Thu, 1 Feb 2018 12:18:28 +0100 Subject: [PATCH] Use #include "..." for our own headers, <...> for others System headers should be included with <...>, our own headers with "...". Offenders tracked down with an ugly, brittle and probably buggy Perl script. Previous iteration was commit a9c94277f0. Delete inclusions of "string.h" and "strings.h" instead of fixing them to and , because we always include these via osdep.h. Put the cleaned up system header includes first. While there, separate #include from file comment with exactly one blank line. Reviewed-by: Eric Blake Reviewed-by: Thomas Huth Signed-off-by: Markus Armbruster Message-Id: <20180201111846.21846-2-armbru@redhat.com> --- contrib/vhost-user-scsi/vhost-user-scsi.c | 4 ++-- hw/ide/sii3112.c | 4 ++-- hw/s390x/s390-ccw.c | 3 ++- include/hw/loader-fit.h | 2 +- include/hw/registerfields.h | 2 +- include/hw/s390x/storage-attributes.h | 2 +- target/i386/hax-all.c | 1 - target/i386/hvf/hvf.c | 1 - target/i386/hvf/x86_decode.c | 1 - target/i386/hvf/x86_mmu.c | 6 ++---- target/i386/hvf/x86_task.c | 1 - target/s390x/gen-features.c | 6 ++---- target/xtensa/core-dc232b/xtensa-modules.c | 2 +- target/xtensa/core-dc233c/xtensa-modules.c | 2 +- target/xtensa/core-de212/xtensa-modules.c | 2 +- target/xtensa/core-fsf/xtensa-modules.c | 2 +- target/xtensa/core-sample_controller/xtensa-modules.c | 2 +- target/xtensa/xtensa-isa.h | 2 +- vl.c | 2 +- 19 files changed, 20 insertions(+), 27 deletions(-) diff --git a/contrib/vhost-user-scsi/vhost-user-scsi.c b/contrib/vhost-user-scsi/vhost-user-scsi.c index 54c1191db0f..02c29019d17 100644 --- a/contrib/vhost-user-scsi/vhost-user-scsi.c +++ b/contrib/vhost-user-scsi/vhost-user-scsi.c @@ -11,10 +11,10 @@ */ #include "qemu/osdep.h" +#include +#include #include "contrib/libvhost-user/libvhost-user-glib.h" #include "standard-headers/linux/virtio_scsi.h" -#include "iscsi/iscsi.h" -#include "iscsi/scsi-lowlevel.h" #include diff --git a/hw/ide/sii3112.c b/hw/ide/sii3112.c index 17aa930e39f..e3896c65b45 100644 --- a/hw/ide/sii3112.c +++ b/hw/ide/sii3112.c @@ -12,8 +12,8 @@ * http://wiki.osdev.org/User:Quok/Silicon_Image_Datasheets */ -#include -#include +#include "qemu/osdep.h" +#include "hw/ide/pci.h" #include "trace.h" #define TYPE_SII3112_PCI "sii3112" diff --git a/hw/s390x/s390-ccw.c b/hw/s390x/s390-ccw.c index 4a9d4d2534d..7fc1c603c07 100644 --- a/hw/s390x/s390-ccw.c +++ b/hw/s390x/s390-ccw.c @@ -10,10 +10,11 @@ * or (at your option) any later version. See the COPYING file in the * top-level directory. */ + #include "qemu/osdep.h" +#include #include "qapi/error.h" #include "hw/sysbus.h" -#include "libgen.h" #include "hw/s390x/css.h" #include "hw/s390x/css-bridge.h" #include "hw/s390x/s390-ccw.h" diff --git a/include/hw/loader-fit.h b/include/hw/loader-fit.h index 9e2a068a209..0284c3e02ce 100644 --- a/include/hw/loader-fit.h +++ b/include/hw/loader-fit.h @@ -20,7 +20,7 @@ #ifndef HW_LOADER_FIT_H #define HW_LOADER_FIT_H -#include +#include "exec/hwaddr.h" struct fit_loader_match { const char *compatible; diff --git a/include/hw/registerfields.h b/include/hw/registerfields.h index 44e0b94edf0..2659a587372 100644 --- a/include/hw/registerfields.h +++ b/include/hw/registerfields.h @@ -11,7 +11,7 @@ #ifndef REGISTERFIELDS_H #define REGISTERFIELDS_H -#include +#include "qemu/bitops.h" /* Define constants for a 32 bit register */ diff --git a/include/hw/s390x/storage-attributes.h b/include/hw/s390x/storage-attributes.h index 9be954d163c..d6403a0a7ed 100644 --- a/include/hw/s390x/storage-attributes.h +++ b/include/hw/s390x/storage-attributes.h @@ -12,7 +12,7 @@ #ifndef S390_STORAGE_ATTRIBUTES_H #define S390_STORAGE_ATTRIBUTES_H -#include +#include "hw/qdev.h" #include "monitor/monitor.h" #define TYPE_S390_STATTRIB "s390-storage_attributes" diff --git a/target/i386/hax-all.c b/target/i386/hax-all.c index 934ec4afd14..bc9a12c1ee0 100644 --- a/target/i386/hax-all.c +++ b/target/i386/hax-all.c @@ -30,7 +30,6 @@ #include "exec/ioport.h" #include "qemu-common.h" -#include "strings.h" #include "hax-i386.h" #include "sysemu/accel.h" #include "sysemu/sysemu.h" diff --git a/target/i386/hvf/hvf.c b/target/i386/hvf/hvf.c index 85e59643651..15870a4f366 100644 --- a/target/i386/hvf/hvf.c +++ b/target/i386/hvf/hvf.c @@ -70,7 +70,6 @@ #include "hw/i386/apic_internal.h" #include "hw/boards.h" #include "qemu/main-loop.h" -#include "strings.h" #include "sysemu/accel.h" #include "sysemu/sysemu.h" #include "target/i386/cpu.h" diff --git a/target/i386/hvf/x86_decode.c b/target/i386/hvf/x86_decode.c index bf93e8207d4..2d7540fe7c7 100644 --- a/target/i386/hvf/x86_decode.c +++ b/target/i386/hvf/x86_decode.c @@ -21,7 +21,6 @@ #include "qemu-common.h" #include "panic.h" #include "x86_decode.h" -#include "string.h" #include "vmx.h" #include "x86_mmu.h" #include "x86_descr.h" diff --git a/target/i386/hvf/x86_mmu.c b/target/i386/hvf/x86_mmu.c index 5c1f35acd06..c6be2cca357 100644 --- a/target/i386/hvf/x86_mmu.c +++ b/target/i386/hvf/x86_mmu.c @@ -15,18 +15,16 @@ * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, see . */ + #include "qemu/osdep.h" +#include #include "panic.h" - #include "qemu-common.h" #include "cpu.h" #include "x86.h" #include "x86_mmu.h" -#include "string.h" #include "vmcs.h" #include "vmx.h" - -#include "memory.h" #include "exec/address-spaces.h" #define pte_present(pte) (pte & PT_PRESENT) diff --git a/target/i386/hvf/x86_task.c b/target/i386/hvf/x86_task.c index d7f665f8fa1..4abf3db25e9 100644 --- a/target/i386/hvf/x86_task.c +++ b/target/i386/hvf/x86_task.c @@ -32,7 +32,6 @@ #include "hw/i386/apic_internal.h" #include "hw/boards.h" #include "qemu/main-loop.h" -#include "strings.h" #include "sysemu/accel.h" #include "sysemu/sysemu.h" #include "target/i386/cpu.h" diff --git a/target/s390x/gen-features.c b/target/s390x/gen-features.c index 0570f597ec9..bd483333aeb 100644 --- a/target/s390x/gen-features.c +++ b/target/s390x/gen-features.c @@ -9,12 +9,10 @@ * This work is licensed under the terms of the GNU GPL, version 2 or (at * your option) any later version. See the COPYING file in the top-level * directory. - * */ - -#include "inttypes.h" -#include "stdio.h" +#include +#include #include "cpu_features_def.h" #define ARRAY_SIZE(array) (sizeof(array) / sizeof(array[0])) diff --git a/target/xtensa/core-dc232b/xtensa-modules.c b/target/xtensa/core-dc232b/xtensa-modules.c index 2e103cd2f53..0af43c84bbf 100644 --- a/target/xtensa/core-dc232b/xtensa-modules.c +++ b/target/xtensa/core-dc232b/xtensa-modules.c @@ -18,7 +18,7 @@ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#include +#include "xtensa-isa.h" #include "xtensa-isa-internal.h" diff --git a/target/xtensa/core-dc233c/xtensa-modules.c b/target/xtensa/core-dc233c/xtensa-modules.c index 2728311c9ad..8a41e736590 100644 --- a/target/xtensa/core-dc233c/xtensa-modules.c +++ b/target/xtensa/core-dc233c/xtensa-modules.c @@ -21,7 +21,7 @@ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#include +#include "xtensa-isa.h" #include "xtensa-isa-internal.h" diff --git a/target/xtensa/core-de212/xtensa-modules.c b/target/xtensa/core-de212/xtensa-modules.c index 4a8735889e1..21f3bd87973 100644 --- a/target/xtensa/core-de212/xtensa-modules.c +++ b/target/xtensa/core-de212/xtensa-modules.c @@ -21,7 +21,7 @@ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#include +#include "xtensa-isa.h" #include "xtensa-isa-internal.h" diff --git a/target/xtensa/core-fsf/xtensa-modules.c b/target/xtensa/core-fsf/xtensa-modules.c index 238800d823a..9621f5142a9 100644 --- a/target/xtensa/core-fsf/xtensa-modules.c +++ b/target/xtensa/core-fsf/xtensa-modules.c @@ -18,7 +18,7 @@ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#include +#include "xtensa-isa.h" #include "xtensa-isa-internal.h" diff --git a/target/xtensa/core-sample_controller/xtensa-modules.c b/target/xtensa/core-sample_controller/xtensa-modules.c index 2f000199b8c..39810e532aa 100644 --- a/target/xtensa/core-sample_controller/xtensa-modules.c +++ b/target/xtensa/core-sample_controller/xtensa-modules.c @@ -21,7 +21,7 @@ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#include +#include "xtensa-isa.h" #include "xtensa-isa-internal.h" diff --git a/target/xtensa/xtensa-isa.h b/target/xtensa/xtensa-isa.h index d06614c187c..0f0211f841a 100644 --- a/target/xtensa/xtensa-isa.h +++ b/target/xtensa/xtensa-isa.h @@ -1 +1 @@ -#include +#include "hw/xtensa/xtensa-isa.h" diff --git a/vl.c b/vl.c index 32db91da1e5..e4c24213535 100644 --- a/vl.c +++ b/vl.c @@ -28,8 +28,8 @@ #include "qemu/uuid.h" #ifdef CONFIG_SECCOMP +#include #include "sysemu/seccomp.h" -#include "sys/prctl.h" #endif #ifdef CONFIG_SDL -- 2.39.5