bulk: Remove unnecessary 'qemu/typedefs.h' include
PATCH 1/1 bulk: Remove unnecessary 'qemu/typedefs.h' include
"qemu/typedefs.h" is already included by "qemu/osdep.h".
--- hw/vfio/vfio-migration-internal.h | 1 - include/system/os-win32.h | 1 - hw/intc/loongarch_extioi_kvm.c | 1 - 3 files changed, 3 deletions(-)
hw/vfio/vfio-migration-internal.h +0 -1
@@ -13,7 +13,6 @@#include <linux/vfio.h> #endif -#include "qemu/typedefs.h" #include "qemu/notify.h" /*
include/system/os-win32.h +0 -1
@@ -29,7 +29,6 @@#include <winsock2.h> #include <windows.h> #include <ws2tcpip.h> -#include "qemu/typedefs.h" #ifdef HAVE_AFUNIX_H #include <afunix.h>
hw/intc/loongarch_extioi_kvm.c +0 -1
@@ -6,7 +6,6 @@*/ #include "qemu/osdep.h" -#include "qemu/typedefs.h" #include "hw/intc/loongarch_extioi.h" #include "linux/kvm.h" #include "qapi/error.h"
Signature · 1 line
2.49.0
Quoted 15 lines · Philippe Mathieu-Daudé
"
qemu/typedefs.h" is already included by "qemu/osdep.h".Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- hw/vfio/vfio-migration-internal.h | 1 - include/system/os-win32.h | 1 - hw/intc/loongarch_extioi_kvm.c | 1 - 3 files changed, 3 deletions(-)include/system/os-win32.h +0
-0
include/system/os-win32.h line 34
Quoted 7 lines
include/system/os-win32.h +0
-1@@ -29,7 +29,6 @@#include <winsock2.h> #include <windows.h> #include <ws2tcpip.h> -#include "qemu/typedefs.h" #ifdef HAVE_AFUNIX_H #include <afunix.h>
This one's tricky -- osdep.h includes system/os-win32.h *before* it includes typedefs.h. If you want to remove this include I think you need to move the include of typedefs.h a bit further up in osdep.h (taking care that it's still wrapped in an "extern C").
(Or we could declare the functions in os-win32.h which use the Error type somewhere else. That header I think is intended to be "Windows specifics and compatibility wrappers that everywhere needs to have sorted out", not "this function happens to only be needed on Windows": a lot of the functions declared in it are only used in a handful of files and don't need to be declared to every source file in the project. But that's a bit more effort.)
The other two changes here are fine.
thanks
-- PMM
Quoted 15 lines · Philippe Mathieu-Daudé
"
qemu/typedefs.h" is already included by "qemu/osdep.h".Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- hw/vfio/vfio-migration-internal.h | 1 - include/system/os-win32.h | 1 - hw/intc/loongarch_extioi_kvm.c | 1 - 3 files changed, 3 deletions(-)include/system/os-win32.h +0
-0
include/system/os-win32.h line 32
Quoted 4 lines
include/system/os-win32.h +0
-1@@ -29,7 +29,6 @@#include <winsock2.h> #include <windows.h> #include <ws2tcpip.h> -#include "qemu/typedefs.h"
This one was introduced in commit f5fd677ae7c ("win32/socket: introduce qemu_socket_select() helper") for Error type, but files including this header should already include "qemu/osdep.h".