From nobody Wed Nov 19 08:24:21 2025 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=1615306352; cv=none; d=zohomail.com; s=zohoarc; b=Oe5Yj007CTCmHeTCBFJsL7e2HLBbMi0kX5Qj6LCg1dGpssnsHFMtyzicti3NBNuOVhZsEY7aS26rouaX6gqljy9Vz+kHiKwNCgVJnk6/udKN7HoNNVquSF7bq++U2be9exbQeLIKyniCcF/rfmG4dyKAoqhShFD+0N5P6z1HvjU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1615306352; 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=HbaIMm2ljaXYqCUDuc4WEiW5Dq3TRodjIprJ/28EClCXE3rAcN5gSd3OK8ltUryaSdaxRcweHu7PP8abXX5YQNGJoYlJ2q+ZMDaJjdXo+rZs3+sXASz/kuG8FjuhSE85Z/lGtRPp0Odoxh0QsKnik3Ptdp7/gdqS4ApOudtCzoQ= 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 1615306352250380.69595774041125; Tue, 9 Mar 2021 08:12:32 -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-287-JOQDlHPuM7GYnX7Sn9x95A-1; Tue, 09 Mar 2021 11:12:28 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 87C9F801817; Tue, 9 Mar 2021 16:12:22 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2B66221EC8; Tue, 9 Mar 2021 16:12:21 +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 3F1BE57DC2; Tue, 9 Mar 2021 16:12:20 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 129GCJOY031687 for ; Tue, 9 Mar 2021 11:12:19 -0500 Received: by smtp.corp.redhat.com (Postfix) id 157D9100239F; Tue, 9 Mar 2021 16:12:19 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-112-83.phx2.redhat.com [10.3.112.83]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8042F1002391; Tue, 9 Mar 2021 16:12:15 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 13FEE1131C01; Tue, 9 Mar 2021 17:12:14 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1615306351; 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=VE2AD/AO1TpZTNW2Lx3S3BGGwZKvigpPzD28cnd0L7tB0Kp6JjdEo+PjUrt1IgyEg5b9dg /wsocfmNbLIYSo4IuIB5Srzq52/XKjCt070kZOD/RqCM5sSZiW0bQYpjCllakZjigfq3vz EG90g5JhWH5en0V+AmQWTiiom87YWIY= X-MC-Unique: JOQDlHPuM7GYnX7Sn9x95A-1 From: Markus Armbruster To: qemu-devel@nongnu.org Subject: [PATCH v3 3/4] fdc: Inline fdctrl_connect_drives() into fdctrl_realize_common() Date: Tue, 9 Mar 2021 17:12:12 +0100 Message-Id: <20210309161214.1402527-4-armbru@redhat.com> In-Reply-To: <20210309161214.1402527-1-armbru@redhat.com> References: <20210309161214.1402527-1-armbru@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com Cc: kwolf@redhat.com, qemu-block@nongnu.org, libvir-list@redhat.com, mreitz@redhat.com, jsnow@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.84 on 10.5.11.23 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