From: Markus Armbruster <armbru@redhat.com>
To: qemu-devel@nongnu.org
Cc: kwolf@redhat.com, berrange@redhat.com, qemu-block@nongnu.org,
libvir-list@redhat.com, richard.henderson@linaro.org,
mreitz@redhat.com, jsnow@redhat.com
Subject: [PATCH v4 3/4] fdc: Inline fdctrl_connect_drives() into fdctrl_realize_common()
Date: Thu, 11 Mar 2021 08:52:20 +0100 [thread overview]
Message-ID: <20210311075221.1795266-4-armbru@redhat.com> (raw)
In-Reply-To: <20210311075221.1795266-1-armbru@redhat.com>
The previous commit rendered the name fdctrl_connect_drives() somewhat
misleading. Get rid of it by inlining the (now pretty simple)
function into its only caller.
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
---
hw/block/fdc.c | 23 ++++++++---------------
1 file changed, 8 insertions(+), 15 deletions(-)
diff --git a/hw/block/fdc.c b/hw/block/fdc.c
index f978ddf647..5210ab85e2 100644
--- a/hw/block/fdc.c
+++ b/hw/block/fdc.c
@@ -2511,20 +2511,6 @@ void isa_fdc_init_drives(ISADevice *fdc, DriveInfo **fds)
fdctrl_init_drives(&ISA_FDC(fdc)->state.bus, fds);
}
-static void fdctrl_connect_drives(FDCtrl *fdctrl, DeviceState *fdc_dev,
- Error **errp)
-{
- unsigned int i;
- FDrive *drive;
-
- for (i = 0; i < MAX_FD; i++) {
- drive = &fdctrl->drives[i];
- drive->fdctrl = fdctrl;
- fd_init(drive);
- fd_revalidate(drive);
- }
-}
-
void fdctrl_init_sysbus(qemu_irq irq, int dma_chann,
hwaddr mmio_base, DriveInfo **fds)
{
@@ -2604,7 +2590,14 @@ static void fdctrl_realize_common(DeviceState *dev, FDCtrl *fdctrl,
}
floppy_bus_create(fdctrl, &fdctrl->bus, dev);
- fdctrl_connect_drives(fdctrl, dev, errp);
+
+ for (i = 0; i < MAX_FD; i++) {
+ FDrive *drive = &fdctrl->drives[i];
+
+ drive->fdctrl = fdctrl;
+ fd_init(drive);
+ fd_revalidate(drive);
+ }
}
static const MemoryRegionPortio fdc_portio_list[] = {
--
2.26.2
next prev parent reply other threads:[~2021-03-11 7:54 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-11 7:52 [PATCH v4 0/4] Drop deprecated floppy config & bogus -drive if=T Markus Armbruster
2021-03-11 7:52 ` [PATCH v4 1/4] docs/system/deprecated: Fix note on fdc drive properties Markus Armbruster
2021-03-11 7:52 ` [PATCH v4 2/4] fdc: Drop deprecated floppy configuration Markus Armbruster
2021-03-11 7:52 ` Markus Armbruster [this message]
2021-03-11 7:52 ` [PATCH v4 4/4] blockdev: Drop deprecated bogus -drive interface type Markus Armbruster
2021-03-11 9:44 ` Daniel P. Berrangé
2021-03-12 1:17 ` [PATCH v4 0/4] Drop deprecated floppy config & bogus -drive if=T John Snow
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=20210311075221.1795266-4-armbru@redhat.com \
--to=armbru@redhat.com \
--cc=berrange@redhat.com \
--cc=jsnow@redhat.com \
--cc=kwolf@redhat.com \
--cc=libvir-list@redhat.com \
--cc=mreitz@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=richard.henderson@linaro.org \
/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.