From nobody Mon Feb 9 16:34:03 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1614852077; cv=none; d=zohomail.com; s=zohoarc; b=nWa0dPh6IGyqZydIjqGwPD2NTcsS5qOE630LMnRo0qEtQbjws8V7cV66cC3MA1vJ/rQQO2oy6Yh1vtuh1sl655MBs4DUb/BiE3vqpZ4hn/3MW8CIAT9ODwJ6e03JyvP/SqPhyx9i03RPFs4frZH907Jez5yjd1wc4tx517/GcnE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1614852077; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=r99EcZb7CQ6mgjNwmAHWGcsYGGYPYZsJegLrB+sOF+I=; b=hPyuGb6/evR5yH3PGOzo0osdBwuajN58s07sg6kXxYOxJTjj5LigZGY1qZXX0m4OmIocN7w+x9gbB0sfCeadwsrj9oVsa8XXrd/K73ETPV4XAVkzKZGDPz978XeV+HHaJ+GajGv4QleRFMNEtqDTEpiFCiW34I/jd9A2FzMd3T4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1614852077819188.63167582233564; Thu, 4 Mar 2021 02:01:17 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-359-zZzBjwg3MPKeRq-IXo77nQ-1; Thu, 04 Mar 2021 05:01:11 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id CDFC419057B5; Thu, 4 Mar 2021 10:01:04 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7C98560C43; Thu, 4 Mar 2021 10:01:04 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id E44921809C86; Thu, 4 Mar 2021 10:01:02 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 124A11Zb012647 for ; Thu, 4 Mar 2021 05:01:01 -0500 Received: by smtp.corp.redhat.com (Postfix) id 7A82A63633; Thu, 4 Mar 2021 10:01:01 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-112-73.ams2.redhat.com [10.36.112.73]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4821B62680; Thu, 4 Mar 2021 10:01:01 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id D6CC71132C14; Thu, 4 Mar 2021 11:00:59 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1614852073; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=r99EcZb7CQ6mgjNwmAHWGcsYGGYPYZsJegLrB+sOF+I=; b=djPDMld459Y8jkx1aiTc4+DltlefBzePPAHTWgzjERLC9KAPn02WwIOtBoHndlBSfYr/ZB cOWs8MnUeiz4FhZr8LEAB2LgYu37HQcf80MIn8MnmZgEgAlrhbN5SWR4MImONJRMg4p+sh 2Nduv2eDmHpfCY3Mxd2H34YXOG93/qg= X-MC-Unique: zZzBjwg3MPKeRq-IXo77nQ-1 From: Markus Armbruster To: qemu-devel@nongnu.org Subject: [PATCH v2 2/3] fdc: Inline fdctrl_connect_drives() into fdctrl_realize_common() Date: Thu, 4 Mar 2021 11:00:58 +0100 Message-Id: <20210304100059.157158-3-armbru@redhat.com> In-Reply-To: <20210304100059.157158-1-armbru@redhat.com> References: <20210304100059.157158-1-armbru@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Cc: kwolf@redhat.com, libvir-list@redhat.com, jsnow@redhat.com, qemu-block@nongnu.org, mreitz@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" 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 --- 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..32701c2bc5 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); } =20 -static void fdctrl_connect_drives(FDCtrl *fdctrl, DeviceState *fdc_dev, - Error **errp) -{ - unsigned int i; - FDrive *drive; - - for (i =3D 0; i < MAX_FD; i++) { - drive =3D &fdctrl->drives[i]; - drive->fdctrl =3D fdctrl; - fd_init(drive); - fd_revalidate(drive); - } -} - void fdctrl_init_sysbus(qemu_irq irq, int dma_chann, hwaddr mmio_base, DriveInfo **fds) { @@ -2565,6 +2551,7 @@ static void fdctrl_realize_common(DeviceState *dev, F= DCtrl *fdctrl, Error **errp) { int i, j; + FDrive *drive; static int command_tables_inited =3D 0; =20 if (fdctrl->fallback =3D=3D FLOPPY_DRIVE_TYPE_AUTO) { @@ -2604,7 +2591,13 @@ static void fdctrl_realize_common(DeviceState *dev, = FDCtrl *fdctrl, } =20 floppy_bus_create(fdctrl, &fdctrl->bus, dev); - fdctrl_connect_drives(fdctrl, dev, errp); + + for (i =3D 0; i < MAX_FD; i++) { + drive =3D &fdctrl->drives[i]; + drive->fdctrl =3D fdctrl; + fd_init(drive); + fd_revalidate(drive); + } } =20 static const MemoryRegionPortio fdc_portio_list[] =3D { --=20 2.26.2