From: Markus Armbruster <armbru@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: "Peter Maydell" <peter.maydell@linaro.org>,
"Thomas Huth" <thuth@redhat.com>,
"Xiao Guangrong" <xiaoguangrong.eric@gmail.com>,
qemu-block@nongnu.org,
"Peter Crosthwaite" <crosthwaite.peter@gmail.com>,
"Philippe Mathieu-Daudé" <philmd@redhat.com>,
"Alistair Francis" <alistair@alistair23.me>,
qemu-devel@nongnu.org, "Philippe Mathieu-Daudé" <f4bug@amsat.org>,
"Greg Kurz" <groug@kaod.org>,
qemu-arm@nongnu.org, "Michael S. Tsirkin" <mst@redhat.com>,
"Gerd Hoffmann" <kraxel@redhat.com>,
"Igor Mammedov" <imammedo@redhat.com>,
"Laszlo Ersek" <lersek@redhat.com>,
"Cédric Le Goater" <clg@kaod.org>
Subject: Re: [Qemu-devel] [PATCH 03/15] hw/ssi: Remove SSIBus from "qemu/typedefs.h"
Date: Thu, 17 Jan 2019 10:03:24 +0100 [thread overview]
Message-ID: <87ef9b64gz.fsf@dusky.pond.sub.org> (raw)
In-Reply-To: <4b24723e-5a27-f25f-76c1-f2f4e94757ba@redhat.com> (Paolo Bonzini's message of "Wed, 16 Jan 2019 11:03:15 +0100")
Paolo Bonzini <pbonzini@redhat.com> writes:
> On 16/01/19 09:33, Markus Armbruster wrote:
>> What problem exactly are we trying to solve here?
>> To the best of my knowledge, typedefs.h has been working just fine for
>> us, and I can't see why it shouldn't continue to work just fine.
>
> Patches don't have to solve problems. They can just help long-term
> maintainability, highlight code smells, etc. Nobody is saying
> typedefs.h doesn't work. But it's a tool, and including headers from
> headers is also a tool. Each tool has its purpose and it is useful to
> question what are the exact purposes of the tools.
>
> typedefs.h is useful to avoid rebuilding the world too often if a type
> is used many times as a pointer, but rarely as a struct and rarely has
> functions called on its instances. This is already a relatively rare
> case, but here we're talking about files that are included less than 20
> times; many of which also already include hw/ssi/ssi.h for their own
> business. So we're hardly rebuilding anything more often, also because
> hw/ssi/ssi.h is not really changing fast.
>
> typedefs.h is also useful to avoid circular header inclusions. Here
> hw/ssi/ssi.h is clearly a toplevel include for the SSI subsystem. I
> agree that includes in a headers _can_ be painful, but sometimes they
> also tell you a hierarchy of what uses what. typedefs.h doesn't;
> forward struct declarations also do, and I all but dislike using them in
> headers (Thomas, can you send v2 of the HACKING patch?).
>
> Therefore, typedefs.h is not particularly useful for SSIBus. It doesn't
> hurt much, if at all, to leave it in. On the other hand, it also
> doesn't hurt much if at all to remove it; it makes the SSI code a very
> tiny little bit more self contained.
>
> It may be that it's not particularly useful just because SSI is small;
> for example I2CBus is also in typedefs.h and it's used a lot more, maybe
> one day SSIBus will be the same. In doubt, let's drop the patch---but I
> think it's useful to have the discussion and there are cases that are
> not controversial at all in Philippe's series.
I fully agree having the discussion is useful, and I also like many of
the patches in Philippe's series.
WARNING: multiple messages have this Message-ID (diff)
From: Markus Armbruster <armbru@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: "Peter Maydell" <peter.maydell@linaro.org>,
"Thomas Huth" <thuth@redhat.com>,
"Alistair Francis" <alistair@alistair23.me>,
"Xiao Guangrong" <xiaoguangrong.eric@gmail.com>,
qemu-block@nongnu.org,
"Peter Crosthwaite" <crosthwaite.peter@gmail.com>,
"Laszlo Ersek" <lersek@redhat.com>,
"Michael S. Tsirkin" <mst@redhat.com>,
qemu-devel@nongnu.org, "Philippe Mathieu-Daudé" <f4bug@amsat.org>,
"Greg Kurz" <groug@kaod.org>,
qemu-arm@nongnu.org, "Gerd Hoffmann" <kraxel@redhat.com>,
"Igor Mammedov" <imammedo@redhat.com>,
"Philippe Mathieu-Daudé" <philmd@redhat.com>,
"Cédric Le Goater" <clg@kaod.org>
Subject: Re: [Qemu-devel] [PATCH 03/15] hw/ssi: Remove SSIBus from "qemu/typedefs.h"
Date: Thu, 17 Jan 2019 10:03:24 +0100 [thread overview]
Message-ID: <87ef9b64gz.fsf@dusky.pond.sub.org> (raw)
In-Reply-To: <4b24723e-5a27-f25f-76c1-f2f4e94757ba@redhat.com> (Paolo Bonzini's message of "Wed, 16 Jan 2019 11:03:15 +0100")
Paolo Bonzini <pbonzini@redhat.com> writes:
> On 16/01/19 09:33, Markus Armbruster wrote:
>> What problem exactly are we trying to solve here?
>> To the best of my knowledge, typedefs.h has been working just fine for
>> us, and I can't see why it shouldn't continue to work just fine.
>
> Patches don't have to solve problems. They can just help long-term
> maintainability, highlight code smells, etc. Nobody is saying
> typedefs.h doesn't work. But it's a tool, and including headers from
> headers is also a tool. Each tool has its purpose and it is useful to
> question what are the exact purposes of the tools.
>
> typedefs.h is useful to avoid rebuilding the world too often if a type
> is used many times as a pointer, but rarely as a struct and rarely has
> functions called on its instances. This is already a relatively rare
> case, but here we're talking about files that are included less than 20
> times; many of which also already include hw/ssi/ssi.h for their own
> business. So we're hardly rebuilding anything more often, also because
> hw/ssi/ssi.h is not really changing fast.
>
> typedefs.h is also useful to avoid circular header inclusions. Here
> hw/ssi/ssi.h is clearly a toplevel include for the SSI subsystem. I
> agree that includes in a headers _can_ be painful, but sometimes they
> also tell you a hierarchy of what uses what. typedefs.h doesn't;
> forward struct declarations also do, and I all but dislike using them in
> headers (Thomas, can you send v2 of the HACKING patch?).
>
> Therefore, typedefs.h is not particularly useful for SSIBus. It doesn't
> hurt much, if at all, to leave it in. On the other hand, it also
> doesn't hurt much if at all to remove it; it makes the SSI code a very
> tiny little bit more self contained.
>
> It may be that it's not particularly useful just because SSI is small;
> for example I2CBus is also in typedefs.h and it's used a lot more, maybe
> one day SSIBus will be the same. In doubt, let's drop the patch---but I
> think it's useful to have the discussion and there are cases that are
> not controversial at all in Philippe's series.
I fully agree having the discussion is useful, and I also like many of
the patches in Philippe's series.
next prev parent reply other threads:[~2019-01-17 9:07 UTC|newest]
Thread overview: 82+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-11 14:08 [Qemu-devel] [PATCH RESEND 00/15] typedefs: Remove scarcely used declarations Philippe Mathieu-Daudé
2019-01-11 14:08 ` Philippe Mathieu-Daudé
2019-01-11 14:08 ` [Qemu-devel] [PATCH 01/15] hw/input/ps2: Remove PS2State from "qemu/typedefs.h" Philippe Mathieu-Daudé
2019-01-11 14:08 ` Philippe Mathieu-Daudé
2019-01-11 14:08 ` [Qemu-devel] [PATCH 02/15] hw/pcmcia: Remove PCMCIACardState " Philippe Mathieu-Daudé
2019-01-11 14:08 ` Philippe Mathieu-Daudé
2019-01-14 8:39 ` [Qemu-arm] " Thomas Huth
2019-01-14 8:39 ` [Qemu-devel] " Thomas Huth
2019-01-11 14:08 ` [Qemu-arm] [PATCH 03/15] hw/ssi: Remove SSIBus " Philippe Mathieu-Daudé
2019-01-11 14:08 ` [Qemu-devel] " Philippe Mathieu-Daudé
2019-01-14 8:44 ` [Qemu-arm] " Thomas Huth
2019-01-14 8:44 ` [Qemu-devel] " Thomas Huth
2019-01-15 12:28 ` [Qemu-arm] " Markus Armbruster
2019-01-15 12:28 ` Markus Armbruster
2019-01-15 12:56 ` Thomas Huth
2019-01-15 12:56 ` Thomas Huth
2019-01-15 18:02 ` [Qemu-arm] " Paolo Bonzini
2019-01-15 18:02 ` Paolo Bonzini
2019-01-16 8:33 ` [Qemu-arm] " Markus Armbruster
2019-01-16 8:33 ` Markus Armbruster
2019-01-16 10:03 ` [Qemu-arm] " Paolo Bonzini
2019-01-16 10:03 ` Paolo Bonzini
2019-01-16 11:34 ` [Qemu-arm] " Gerd Hoffmann
2019-01-16 11:34 ` Gerd Hoffmann
2019-01-16 11:49 ` [Qemu-arm] " Paolo Bonzini
2019-01-16 11:49 ` Paolo Bonzini
2019-01-16 14:48 ` [Qemu-arm] " Michael S. Tsirkin
2019-01-16 14:48 ` Michael S. Tsirkin
2019-01-17 9:01 ` Markus Armbruster
2019-01-17 9:01 ` Markus Armbruster
2019-01-17 9:03 ` Markus Armbruster [this message]
2019-01-17 9:03 ` Markus Armbruster
2019-01-15 17:57 ` Paolo Bonzini
2019-01-15 17:57 ` Paolo Bonzini
2019-01-16 8:32 ` [Qemu-arm] " Markus Armbruster
2019-01-16 8:32 ` Markus Armbruster
2019-01-11 14:08 ` [Qemu-arm] [PATCH 04/15] hw/ide/ahci: Remove AllwinnerAHCIState " Philippe Mathieu-Daudé
2019-01-11 14:08 ` [Qemu-devel] " Philippe Mathieu-Daudé
2019-01-14 8:45 ` [Qemu-arm] " Thomas Huth
2019-01-14 8:45 ` [Qemu-devel] " Thomas Huth
2019-01-11 14:08 ` [Qemu-arm] [PATCH 05/15] hw/nvram/fw_cfg: Remove various typedefs " Philippe Mathieu-Daudé
2019-01-11 14:08 ` [Qemu-devel] " Philippe Mathieu-Daudé
2019-01-11 16:26 ` [Qemu-arm] " Laszlo Ersek
2019-01-11 16:26 ` [Qemu-devel] " Laszlo Ersek
2019-01-14 10:26 ` [Qemu-arm] " Philippe Mathieu-Daudé
2019-01-14 10:26 ` [Qemu-devel] " Philippe Mathieu-Daudé
2019-01-11 14:08 ` [Qemu-arm] [PATCH 06/15] hw/i2c/smbus: Remove SMBusDevice " Philippe Mathieu-Daudé
2019-01-11 14:08 ` [Qemu-devel] " Philippe Mathieu-Daudé
2019-01-11 14:08 ` [Qemu-arm] [PATCH 07/15] hw/bt: Remove HCIInfo " Philippe Mathieu-Daudé
2019-01-11 14:08 ` [Qemu-devel] " Philippe Mathieu-Daudé
2019-01-11 14:08 ` [Qemu-devel] [PATCH 08/15] hw/char/serial: Remove SerialState " Philippe Mathieu-Daudé
2019-01-11 14:08 ` Philippe Mathieu-Daudé
2019-01-11 14:08 ` [Qemu-devel] [PATCH 09/15] hw/i386: Remove PCMachineClass " Philippe Mathieu-Daudé
2019-01-11 14:08 ` Philippe Mathieu-Daudé
2019-01-11 14:08 ` [Qemu-arm] [PATCH 10/15] range: Remove Range " Philippe Mathieu-Daudé
2019-01-11 14:08 ` [Qemu-devel] " Philippe Mathieu-Daudé
2019-01-14 8:56 ` [Qemu-arm] " Thomas Huth
2019-01-14 8:56 ` [Qemu-devel] " Thomas Huth
2019-01-14 10:30 ` [Qemu-arm] " Philippe Mathieu-Daudé
2019-01-14 10:30 ` [Qemu-devel] " Philippe Mathieu-Daudé
2019-01-11 14:08 ` [Qemu-devel] [PATCH 11/15] audio: Remove AudioState " Philippe Mathieu-Daudé
2019-01-11 14:08 ` Philippe Mathieu-Daudé
2019-01-11 14:08 ` [Qemu-devel] [PATCH 12/15] ui/console: Remove MouseTransformInfo from qemu/typedefs.h Philippe Mathieu-Daudé
2019-01-11 14:08 ` Philippe Mathieu-Daudé
2019-01-14 8:59 ` [Qemu-arm] " Thomas Huth
2019-01-14 8:59 ` [Qemu-devel] " Thomas Huth
2019-01-14 12:59 ` Philippe Mathieu-Daudé
2019-01-14 12:59 ` Philippe Mathieu-Daudé
2019-01-11 14:08 ` [Qemu-devel] [PATCH 13/15] ui/console: Remove QemuDmaBuf from "qemu/typedefs.h" Philippe Mathieu-Daudé
2019-01-11 14:08 ` Philippe Mathieu-Daudé
2019-01-11 14:08 ` [Qemu-arm] [PATCH 14/15] ui/console: Remove DisplayState/DisplaySurface " Philippe Mathieu-Daudé
2019-01-11 14:08 ` [Qemu-devel] " Philippe Mathieu-Daudé
2019-01-11 14:08 ` [Qemu-arm] [RFC PATCH 15/15] ui/console: Add "ui/pixelformat.h" to declare PixelFormat Philippe Mathieu-Daudé
2019-01-11 14:08 ` [Qemu-devel] " Philippe Mathieu-Daudé
2019-01-11 17:32 ` [Qemu-arm] " Paolo Bonzini
2019-01-11 17:32 ` [Qemu-devel] " Paolo Bonzini
2019-01-14 10:24 ` [Qemu-arm] " Philippe Mathieu-Daudé
2019-01-14 10:24 ` [Qemu-devel] " Philippe Mathieu-Daudé
2019-01-14 12:35 ` [Qemu-arm] " Gerd Hoffmann
2019-01-14 12:35 ` [Qemu-devel] " Gerd Hoffmann
2019-01-14 12:41 ` [Qemu-arm] " Philippe Mathieu-Daudé
2019-01-14 12:41 ` [Qemu-devel] " Philippe Mathieu-Daudé
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=87ef9b64gz.fsf@dusky.pond.sub.org \
--to=armbru@redhat.com \
--cc=alistair@alistair23.me \
--cc=clg@kaod.org \
--cc=crosthwaite.peter@gmail.com \
--cc=f4bug@amsat.org \
--cc=groug@kaod.org \
--cc=imammedo@redhat.com \
--cc=kraxel@redhat.com \
--cc=lersek@redhat.com \
--cc=mst@redhat.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=philmd@redhat.com \
--cc=qemu-arm@nongnu.org \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=thuth@redhat.com \
--cc=xiaoguangrong.eric@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.