From: Cornelia Huck <cohuck@redhat.com>
To: Thomas Huth <thuth@redhat.com>
Cc: "Peter Maydell" <peter.maydell@linaro.org>,
"Markus Armbruster" <armbru@redhat.com>,
"QEMU Developers" <qemu-devel@nongnu.org>,
"Halil Pasic" <pasic@linux.ibm.com>,
"Christian Borntraeger" <borntraeger@de.ibm.com>,
qemu-s390x <qemu-s390x@nongnu.org>,
"Philippe Mathieu-Daudé" <philmd@redhat.com>
Subject: Re: [PATCH] hw/watchdog/wdt_diag288: Remove unnecessary includes
Date: Tue, 24 Nov 2020 12:02:44 +0100 [thread overview]
Message-ID: <20201124120244.2b2c5d6d.cohuck@redhat.com> (raw)
In-Reply-To: <7e1483d6-8767-0d0f-105d-b55d2d6d6165@redhat.com>
On Mon, 23 Nov 2020 19:41:40 +0100
Thomas Huth <thuth@redhat.com> wrote:
> On 23/11/2020 16.59, Cornelia Huck wrote:
> > On Mon, 23 Nov 2020 11:47:25 +0100
> > Markus Armbruster <armbru@redhat.com> wrote:
> >
> >> Thomas Huth <thuth@redhat.com> writes:
> >>
> >>> On 18/11/2020 15.30, Peter Maydell wrote:
> >>>> On Wed, 18 Nov 2020 at 14:24, Markus Armbruster <armbru@redhat.com> wrote:
> >>>>>
> >>>>> Philippe Mathieu-Daudé <philmd@redhat.com> writes:
> >>>>>
> >>>>>> On 11/18/20 10:03 AM, Thomas Huth wrote:
> >>>>>>> Both headers, sysbus.h and module.h, are not required to compile this file.
> >>>>>
> >>>>> module.h is: it defines type_init().
> >>>>
> >>>>>>> #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.h where needed, drop it from qemu-common.h
> >>>>>
> >>>>> If 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?
> >>
> >> 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."
>
> 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.
next prev parent reply other threads:[~2020-11-24 11:06 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-18 9:03 [PATCH] hw/watchdog/wdt_diag288: Remove unnecessary includes Thomas Huth
2020-11-18 9:06 ` Christian Borntraeger
2020-11-18 11:06 ` Philippe Mathieu-Daudé
2020-11-18 14:22 ` Markus Armbruster
2020-11-18 14:30 ` Peter Maydell
2020-11-23 8:16 ` Thomas Huth
2020-11-23 10:47 ` Markus Armbruster
2020-11-23 15:59 ` Cornelia Huck
2020-11-23 18:41 ` Thomas Huth
2020-11-24 11:02 ` Cornelia Huck [this message]
2020-11-24 11:03 ` Cornelia Huck
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20201124120244.2b2c5d6d.cohuck@redhat.com \
--to=cohuck@redhat.com \
--cc=armbru@redhat.com \
--cc=borntraeger@de.ibm.com \
--cc=pasic@linux.ibm.com \
--cc=peter.maydell@linaro.org \
--cc=philmd@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-s390x@nongnu.org \
--cc=thuth@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).