From nobody Wed Nov 5 17:50:38 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; dkim=fail spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1496718200174960.1986975185038; Mon, 5 Jun 2017 20:03:20 -0700 (PDT) Received: from localhost ([::1]:36000 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dI4m6-0006KM-NE for importer@patchew.org; Mon, 05 Jun 2017 23:03:18 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54315) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dI4ay-0003VM-DB for qemu-devel@nongnu.org; Mon, 05 Jun 2017 22:51:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dI4ax-0002zQ-07 for qemu-devel@nongnu.org; Mon, 05 Jun 2017 22:51:48 -0400 Received: from ozlabs.org ([2401:3900:2:1::2]:40485) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dI4aw-0002xj-Hg; Mon, 05 Jun 2017 22:51:46 -0400 Received: by ozlabs.org (Postfix, from userid 1007) id 3whbmq4S9qz9s8Y; Tue, 6 Jun 2017 12:51:39 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1496717499; bh=wrbCkmCSqXbrAR3sExwLGcLcxCOehN0PGh61UFjL2zQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cN2o8I8gQJ21HkDQB+XJsDgavM4iRmkGpUmPHMOn559K30dMTS10tamHYqOlxJ6zI I6JavBaDpO7c1jvkeB2V1pwIHqvvkWpL0EuXOZycTgUw04I1vUM4uyrWEfUZuqPQUb +/GldOK7eXfnTVq6GHcP6lEPtcvi1xDLKnqelKVw= From: David Gibson To: peter.maydell@linaro.org Date: Tue, 6 Jun 2017 12:51:23 +1000 Message-Id: <20170606025135.2685-6-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.9.4 In-Reply-To: <20170606025135.2685-1-david@gibson.dropbear.id.au> References: <20170606025135.2685-1-david@gibson.dropbear.id.au> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2401:3900:2:1::2 Subject: [Qemu-devel] [PULL 05/17] spapr: Abolish DRC set_configured method X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: mdroth@linux.vnet.ibm.com, David Gibson , qemu-ppc@nongnu.org, agraf@suse.de, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" DRConnectorClass has a set_configured method, however: * There is only one implementation, and only ever likely to be one * There's exactly one caller, and that's (now) local * The implementation is very straightforward So abolish the method entirely, and just open-code what we need. Signed-off-by: David Gibson Reviewed-by: Laurent Vivier Reviewed-by: Greg Kurz Tested-by: Daniel Barboza --- hw/ppc/spapr_drc.c | 24 ++++++++---------------- include/hw/ppc/spapr_drc.h | 3 --- 2 files changed, 8 insertions(+), 19 deletions(-) diff --git a/hw/ppc/spapr_drc.c b/hw/ppc/spapr_drc.c index f5b7b68..693571a 100644 --- a/hw/ppc/spapr_drc.c +++ b/hw/ppc/spapr_drc.c @@ -199,18 +199,6 @@ static const char *get_name(sPAPRDRConnector *drc) return drc->name; } =20 -static void set_configured(sPAPRDRConnector *drc) -{ - trace_spapr_drc_set_configured(get_index(drc)); - - if (drc->isolation_state !=3D SPAPR_DR_ISOLATION_STATE_UNISOLATED) { - /* guest should be not configuring an isolated device */ - trace_spapr_drc_set_configured_skipping(get_index(drc)); - return; - } - drc->configured =3D true; -} - /* has the guest been notified of device attachment? */ static void set_signalled(sPAPRDRConnector *drc) { @@ -745,7 +733,6 @@ static void spapr_dr_connector_class_init(ObjectClass *= k, void *data) drck->get_index =3D get_index; drck->get_type =3D get_type; drck->get_name =3D get_name; - drck->set_configured =3D set_configured; drck->entity_sense =3D entity_sense; drck->attach =3D attach; drck->detach =3D detach; @@ -1113,7 +1100,6 @@ static void rtas_ibm_configure_connector(PowerPCCPU *= cpu, uint64_t wa_offset; uint32_t drc_index; sPAPRDRConnector *drc; - sPAPRDRConnectorClass *drck; sPAPRConfigureConnectorState *ccs; sPAPRDRCCResponse resp =3D SPAPR_DR_CC_RESPONSE_CONTINUE; int rc; @@ -1133,7 +1119,6 @@ static void rtas_ibm_configure_connector(PowerPCCPU *= cpu, goto out; } =20 - drck =3D SPAPR_DR_CONNECTOR_GET_CLASS(drc); if (!drc->fdt) { trace_spapr_rtas_ibm_configure_connector_missing_fdt(drc_index); rc =3D SPAPR_DR_CC_RESPONSE_NOT_CONFIGURABLE; @@ -1170,10 +1155,17 @@ static void rtas_ibm_configure_connector(PowerPCCPU= *cpu, case FDT_END_NODE: ccs->fdt_depth--; if (ccs->fdt_depth =3D=3D 0) { + sPAPRDRIsolationState state =3D drc->isolation_state; /* done sending the device tree, don't need to track * the state anymore */ - drck->set_configured(drc); + trace_spapr_drc_set_configured(get_index(drc)); + if (state =3D=3D SPAPR_DR_ISOLATION_STATE_UNISOLATED) { + drc->configured =3D true; + } else { + /* guest should be not configuring an isolated device = */ + trace_spapr_drc_set_configured_skipping(get_index(drc)= ); + } spapr_ccs_remove(spapr, ccs); ccs =3D NULL; resp =3D SPAPR_DR_CC_RESPONSE_SUCCESS; diff --git a/include/hw/ppc/spapr_drc.h b/include/hw/ppc/spapr_drc.h index 80db955..90f4953 100644 --- a/include/hw/ppc/spapr_drc.h +++ b/include/hw/ppc/spapr_drc.h @@ -177,9 +177,6 @@ typedef struct sPAPRDRConnectorClass { =20 uint32_t (*entity_sense)(sPAPRDRConnector *drc, sPAPRDREntitySense *st= ate); =20 - /* QEMU interfaces for managing FDT/configure-connector */ - void (*set_configured)(sPAPRDRConnector *drc); - /* QEMU interfaces for managing hotplug operations */ void (*attach)(sPAPRDRConnector *drc, DeviceState *d, void *fdt, int fdt_start_offset, bool coldplug, Error **errp); --=20 2.9.4