From nobody Tue Nov 18 18:23:22 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=1611592054; cv=none; d=zohomail.com; s=zohoarc; b=CpLPFTNFbbKdQe/9w4boMxSHXugA2So+2IRdzK4q/hZLpxCwDbhHMHbv8x84JioTjtcd6f9V90dUKmBnJC7lP20ARoTAhJIjG6l5B+rGSeO/DLjsLXtrutTuRDCLQTnA2TIpJTCONoH12CZdNia41Lr4xMCsu+qG3ik0lCjaekA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1611592054; 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=HKP7Q7osLsvT1soIEA1W+zmnEf7Juc8PolyMuH5YceI=; b=delY4lCnKaVJqovhHMIT0HOCBt2i45VsrjBZdJbHYY3DUqiehvv6eHpeyAR4O4vWunEtqL1waHes5X+7KJVn3GeHib+T59eNxtGHUtqVIEQgXIY8babv179HTBXVfFtPmWyaxKoHVo9VJapqciaOucJfhLefoaexC8euwfYOT6A= 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 1611592054107909.5067751155069; Mon, 25 Jan 2021 08:27:34 -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-37-qCvDEaqFPw6uWdYlFaYMsg-1; Mon, 25 Jan 2021 11:27:29 -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 76C9B801817; Mon, 25 Jan 2021 16:27:22 +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 5562D60C0F; Mon, 25 Jan 2021 16:27:22 +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 08A071809CA0; Mon, 25 Jan 2021 16:27:22 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 10PGO8ie021405 for ; Mon, 25 Jan 2021 11:24:08 -0500 Received: by smtp.corp.redhat.com (Postfix) id 0F1635D9DE; Mon, 25 Jan 2021 16:24:08 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-113-224.ams2.redhat.com [10.36.113.224]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7E1ED5D9DB; Mon, 25 Jan 2021 16:24:04 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 0EC0F1138461; Mon, 25 Jan 2021 17:24:03 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1611592053; 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=HKP7Q7osLsvT1soIEA1W+zmnEf7Juc8PolyMuH5YceI=; b=ihlZkPz315IDCxbauH05crqkRVi3W64KW7i4mrtz3wUDP4+nGtldvK3bGHU174fh9dxzz4 xKL4tA6gXtjxgIYHhyWBcEuV4BAQ1KRdau4Qu+lWuQqzAXbX6Hgkg/DALC1oUVP/BvSsd9 klhky56Ilzf77XuOTLQPBx7HTNjt5K4= X-MC-Unique: qCvDEaqFPw6uWdYlFaYMsg-1 From: Markus Armbruster To: qemu-devel@nongnu.org Subject: [PATCH 2/3] fdc: Inline fdctrl_connect_drives() into fdctrl_realize_common() Date: Mon, 25 Jan 2021 17:24:01 +0100 Message-Id: <20210125162402.1807394-3-armbru@redhat.com> In-Reply-To: <20210125162402.1807394-1-armbru@redhat.com> References: <20210125162402.1807394-1-armbru@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 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_realize_common() 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 c6c9393e29..7fc547c62d 100644 --- a/hw/block/fdc.c +++ b/hw/block/fdc.c @@ -2521,20 +2521,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) { @@ -2575,6 +2561,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) { @@ -2614,7 +2601,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