hw/watchdog/wdt_diag288: Remove unnecessary includes
PATCH 1/1 hw/watchdog/wdt_diag288: Remove unnecessary includes
Both headers, sysbus.h and module.h, are not required to compile this file.
--- hw/watchdog/wdt_diag288.c | 2 -- 1 file changed, 2 deletions(-)
hw/watchdog/wdt_diag288.c +0 -2
@@ -14,12 +14,10 @@#include "qemu/osdep.h" #include "sysemu/reset.h" #include "sysemu/watchdog.h" -#include "hw/sysbus.h" #include "qemu/timer.h" #include "hw/watchdog/wdt_diag288.h" #include "migration/vmstate.h" #include "qemu/log.h" -#include "qemu/module.h" static WatchdogTimerModel model = { .wdt_name =TYPE_WDT_DIAG288 ,
Signature · 1 line
2.18.4
Quoted 3 lines · Thomas Huth
Both headers,
sysbus.handmodule.h, are not required to compile this file.Signed-off-by Thomas Huth <[email protected]>
It is not a sysbus device and not a module.
Quoted 22 lines
--- hw/watchdog/wdt_diag288.c | 2 -- 1 file changed, 2 deletions(-)hw/watchdog/wdt_diag288.c +0
-2@@ -14,12 +14,10 @@#include "qemu/osdep.h" #include "sysemu/reset.h" #include "sysemu/watchdog.h" -#include "hw/sysbus.h" #include "qemu/timer.h" #include "hw/watchdog/wdt_diag288.h" #include "migration/vmstate.h" #include "qemu/log.h" -#include "qemu/module.h" static WatchdogTimerModel model = { .wdt_name =TYPE_WDT_DIAG288 ,
Quoted 12 lines · Thomas Huth
Both headers,
sysbus.handmodule.h, are not required to compile this file.Signed-off-by Thomas Huth <[email protected]>--- hw/watchdog/wdt_diag288.c | 2 -- 1 file changed, 2 deletions(-)hw/watchdog/wdt_diag288.c +0
-0
hw/watchdog/wdt_diag288.c line 17
Quoted 4 lines
hw/watchdog/wdt_diag288.c +0
-1@@ -14,12 +14,10 @@#include "qemu/osdep.h" #include "sysemu/reset.h" #include "sysemu/watchdog.h" -#include "hw/sysbus.h"
OK
hw/watchdog/wdt_diag288.c line 22
Quoted 5 lines
hw/watchdog/wdt_diag288.c +0
-1#include "qemu/timer.h" #include "hw/watchdog/wdt_diag288.h" #include "migration/vmstate.h" #include "qemu/log.h" -#include "qemu/module.h"
Cc'ing Markus because of:
commit 0b8fa32f551e863bb548a11394239239270dd3dc
Author: Markus Armbruster <[email protected]> Date: Thu May 23 16:35:07 2019 +0200
Include qemu/module.h where needed, drop it from qemu-common.h
Quoted 4 lines
hw/watchdog/wdt_diag288.c +0
-0static WatchdogTimerModel model = { .wdt_name =TYPE_WDT_DIAG288 ,
Quoted 2 lines · Philippe Mathieu-Daudé
Quoted 1 line · Thomas Huth
Both headers,
sysbus.handmodule.h, are not required to compile this file.
module.h is: it defines type_init().
Quoted 24 lines
Quoted 11 lines
Signed-off-by Thomas Huth <[email protected]>--- hw/watchdog/wdt_diag288.c | 2 -- 1 file changed, 2 deletions(-)hw/watchdog/wdt_diag288.c +0
-0hw/watchdog/wdt_diag288.c line 17
Quoted 4 lines
hw/watchdog/wdt_diag288.c +0
-1@@ -14,12 +14,10 @@#include "qemu/osdep.h" #include "sysemu/reset.h" #include "sysemu/watchdog.h" -#include "hw/sysbus.h" OK
hw/watchdog/wdt_diag288.c line 22
Quoted 5 lines
hw/watchdog/wdt_diag288.c +0
-1#include "qemu/timer.h" #include "hw/watchdog/wdt_diag288.h" #include "migration/vmstate.h" #include "qemu/log.h" -#include "qemu/module.h"
Quoted 7 lines
Cc'ing Markus because of:
commit
0b8fa32f551e863bb548a11394239239270dd3dcAuthor: Markus Armbruster <[email protected]> Date: Thu May 23 16:35:07 2019 +0200Include
qemu/module.hwhere needed, drop it fromqemu-common.h
If it still compiles and links, it must get it via some other header.
Quoted 4 lines
Quoted 4 lines
hw/watchdog/wdt_diag288.c +0
-0static WatchdogTimerModel model = { .wdt_name =TYPE_WDT_DIAG288 ,
Quoted 14 lines · Markus Armbruster
Quoted 2 lines · Philippe Mathieu-Daudé
Quoted 1 line · Thomas Huth
Both headers,
sysbus.handmodule.h, are not required to compile this file.
module.his: it definestype_init().Quoted 6 lines
Quoted 5 lines
#include "
qemu/timer.h"
#include "hw/watchdog/wdt_diag288.h"
#include "migration/vmstate.h"
#include "qemu/log.h"
-#include "qemu/module.h"
Quoted 5 lines
Quoted 3 lines
Cc'ing Markus because of:
Include
qemu/module.hwhere needed, drop it fromqemu-common.hIf it still compiles and links, it must get it via some other header.
Yes: wdt_diag288.c -> include/hw/watchdog/wdt_diag288.h ->
include/qom/object.h -> include/qemu/module.h
thanks
-- PMM
Quoted 15 lines · Peter Maydell
Quoted 14 lines · Markus Armbruster
Quoted 2 lines · Philippe Mathieu-Daudé
Quoted 1 line · Thomas Huth
Both headers,
sysbus.handmodule.h, are not required to compile this file.
module.his: it definestype_init().Quoted 6 lines
Quoted 5 lines
#include "
qemu/timer.h"
#include "hw/watchdog/wdt_diag288.h"
#include "migration/vmstate.h"
#include "qemu/log.h"
-#include "qemu/module.h"
Quoted 8 lines
Quoted 5 lines
Quoted 3 lines
Cc'ing Markus because of:
Include
qemu/module.hwhere needed, drop it fromqemu-common.hIf it still compiles and links, it must get it via some other header.
Yes:
wdt_diag288.c->include/hw/watchdog/wdt_diag288.h->
include/qom/object.h->include/qemu/module.h
So what's now our expectation here? Should every file that uses type_init() also include module.h ? That's IMHO not very intuitive...
Or are we fine that type_init() is provided by qom/object.h which needs to be pulled in by every device sooner or later anyway?
Thomas
Quoted 22 lines · Thomas Huth
Quoted 21 lines · Peter Maydell
Quoted 19 lines · Markus Armbruster
Quoted 2 lines · Philippe Mathieu-Daudé
Quoted 1 line · Thomas Huth
Both headers,
sysbus.handmodule.h, are not required to compile this file.
module.his: it definestype_init().Quoted 9 lines
Quoted 5 lines
#include "
qemu/timer.h"
#include "hw/watchdog/wdt_diag288.h"
#include "migration/vmstate.h"
#include "qemu/log.h"
-#include "qemu/module.h"Cc'ing Markus because of:
Include
qemu/module.hwhere needed, drop it fromqemu-common.hIf it still compiles and links, it must get it via some other header.
Quoted 7 lines
Quoted 2 lines
Yes:
wdt_diag288.c->include/hw/watchdog/wdt_diag288.h->
include/qom/object.h->include/qemu/module.hSo what's now our expectation here? Should every file that uses
type_init()also includemodule.h? That's IMHO not very intuitive...
Or are we fine thattype_init()is provided byqom/object.hwhich needs to be pulled in by every device sooner or later anyway?
I think it's okay to rely on indirect inclusion.
Quoted 27 lines · On Mon, 23 Nov 2020 11:47:25 +0100 Markus Armbruster <[email protected]> wrote:
Quoted 25 lines · Thomas Huth
Quoted 23 lines · Peter Maydell
Quoted 14 lines · Markus Armbruster
Quoted 2 lines · Philippe Mathieu-Daudé
Quoted 1 line · Thomas Huth
Both headers,
sysbus.handmodule.h, are not required to compile this file.
module.his: it definestype_init().Quoted 6 lines
Quoted 5 lines
#include "
qemu/timer.h"
#include "hw/watchdog/wdt_diag288.h"
#include "migration/vmstate.h"
#include "qemu/log.h"
-#include "qemu/module.h"Quoted 5 lines
Quoted 3 lines
Cc'ing Markus because of:
Include
qemu/module.hwhere needed, drop it fromqemu-common.hIf it still compiles and links, it must get it via some other header.
Yes:
wdt_diag288.c->include/hw/watchdog/wdt_diag288.h->
include/qom/object.h->include/qemu/module.h
Quoted 6 lines
Quoted 4 lines
So what's now our expectation here? Should every file that uses
type_init()also includemodule.h? That's IMHO not very intuitive...
Or are we fine thattype_init()is provided byqom/object.hwhich needs to be pulled in by every device sooner or later anyway?I think it's okay to rely on indirect inclusion.
So, what's the final verdict? Maybe just tweak the description?
"Neither sysbus.h nor module.h are required to compile this file. diag288 is not a sysbus device, and module.h (for type_init) is included eventually through qom/object.h."
Quoted 35 lines · Cornelia Huck
Quoted 32 lines · On Mon, 23 Nov 2020 11:47:25 +0100 Markus Armbruster <[email protected]> wrote:
Quoted 29 lines · Thomas Huth
Quoted 15 lines · Peter Maydell
Quoted 14 lines · Markus Armbruster
Quoted 2 lines · Philippe Mathieu-Daudé
Quoted 1 line · Thomas Huth
Both headers,
sysbus.handmodule.h, are not required to compile this file.
module.his: it definestype_init().Quoted 6 lines
Quoted 5 lines
#include "
qemu/timer.h"
#include "hw/watchdog/wdt_diag288.h"
#include "migration/vmstate.h"
#include "qemu/log.h"
-#include "qemu/module.h"Quoted 8 lines
Quoted 5 lines
Quoted 3 lines
Cc'ing Markus because of:
Include
qemu/module.hwhere needed, drop it fromqemu-common.hIf it still compiles and links, it must get it via some other header.
Yes:
wdt_diag288.c->include/hw/watchdog/wdt_diag288.h->
include/qom/object.h->include/qemu/module.hSo what's now our expectation here? Should every file that uses
type_init()also includemodule.h? That's IMHO not very intuitive...
Or are we fine thattype_init()is provided byqom/object.hwhich needs to be pulled in by every device sooner or later anyway?
Quoted 7 lines
Quoted 1 line
I think it's okay to rely on indirect inclusion.
So, what's the final verdict? Maybe just tweak the description?
"Neither
sysbus.hnormodule.hare required to compile this file. diag288 is not a sysbus device, andmodule.h(fortype_init) is included eventually throughqom/object.h."
Yes, I think that's the way to go. Could you update the description when picking up the patch, or shall I send a v2?
Thomas
Quoted 38 lines · On Mon, 23 Nov 2020 19:41:40 +0100 Thomas Huth <[email protected]> wrote:
Quoted 37 lines · Cornelia Huck
Quoted 33 lines · On Mon, 23 Nov 2020 11:47:25 +0100 Markus Armbruster <[email protected]> wrote:
Quoted 22 lines · Thomas Huth
Quoted 21 lines · Peter Maydell
Quoted 19 lines · Markus Armbruster
Quoted 2 lines · Philippe Mathieu-Daudé
Quoted 1 line · Thomas Huth
Both headers,
sysbus.handmodule.h, are not required to compile this file.
module.his: it definestype_init().Quoted 9 lines
Quoted 5 lines
#include "
qemu/timer.h"
#include "hw/watchdog/wdt_diag288.h"
#include "migration/vmstate.h"
#include "qemu/log.h"
-#include "qemu/module.h"Cc'ing Markus because of:
Include
qemu/module.hwhere needed, drop it fromqemu-common.hIf it still compiles and links, it must get it via some other header.
Quoted 7 lines
Quoted 2 lines
Yes:
wdt_diag288.c->include/hw/watchdog/wdt_diag288.h->
include/qom/object.h->include/qemu/module.hSo what's now our expectation here? Should every file that uses
type_init()also includemodule.h? That's IMHO not very intuitive...
Or are we fine thattype_init()is provided byqom/object.hwhich needs to be pulled in by every device sooner or later anyway?I think it's okay to rely on indirect inclusion.
Quoted 8 lines
Quoted 5 lines
So, what's the final verdict? Maybe just tweak the description?
"Neither
sysbus.hnormodule.hare required to compile this file. diag288 is not a sysbus device, andmodule.h(fortype_init) is included eventually throughqom/object.h."Yes, I think that's the way to go. Could you update the description when picking up the patch, or shall I send a v2?
No need for a v2, I queued it to s390-next with an updated description.
Cornelia Huck
AppliedQuoted 14 lines · On Wed, 18 Nov 2020 10:03:44 +0100 Thomas Huth <[email protected]> wrote:
Both headers,
sysbus.handmodule.h, are not required to compile this file.Signed-off-by Thomas Huth <[email protected]>--- hw/watchdog/wdt_diag288.c | 2 -- 1 file changed, 2 deletions(-)hw/watchdog/wdt_diag288.c +0
-0@@ -14,12 +14,10 @@#include "qemu/osdep.h" #include "sysemu/reset.h"
hw/watchdog/wdt_diag288.c line 23
Quoted 10 lines
hw/watchdog/wdt_diag288.c +0
-2#include "sysemu/watchdog.h" -#include "hw/sysbus.h" #include "qemu/timer.h" #include "hw/watchdog/wdt_diag288.h" #include "migration/vmstate.h" #include "qemu/log.h" -#include "qemu/module.h" static WatchdogTimerModel model = { .wdt_name =TYPE_WDT_DIAG288 ,
Thanks, applied.