From nobody Fri May 17 07:56:17 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1676271960; cv=none; d=zohomail.com; s=zohoarc; b=Fz3dU9D0Pjk0klya8/F4/r3YrXlPppfhrGRxJyqqhtRZrHiaKLk0IrjHWWfSqzllwz07Z9nymPxpoxdAxELsC5fx9f9RhZ1vAFrfV2xl6WCHWVA8f7pX2tIlnefRobHbh1zY2FQPN5P2ak4jn0XRQqzedpp/KZKCrQbQSkb6pxk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1676271960; 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=XKF2b7pEm6HyiNp404lQ+Vuu44DHRtt9tfJtec4bL+4=; b=R9C/YKMp+j6zeOAbbCO81h5Xw7bp8j1JNew3mgojkakpWK9duyD32KA00lBnYsKwUv1SP7cdhveWN3wf5io9+GkJw5tjOqnWCT04/5WecFVnqkqwlW7pxwIfcLtsnZa7CzVkH5fLDNZVbEo+iGdHZfaDS3C11KnPl4+HhpgzDus= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 16762719603001004.6611595598847; Sun, 12 Feb 2023 23:06:00 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pRStD-0000id-N9; Mon, 13 Feb 2023 02:04:39 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pRSt7-0000hu-Vz for qemu-devel@nongnu.org; Mon, 13 Feb 2023 02:04:34 -0500 Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pRSt6-0000i0-DJ for qemu-devel@nongnu.org; Mon, 13 Feb 2023 02:04:33 -0500 Received: by mail-wm1-x32e.google.com with SMTP id k8-20020a05600c1c8800b003dc57ea0dfeso10557321wms.0 for ; Sun, 12 Feb 2023 23:04:32 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id o19-20020a05600c4fd300b003dc59d6f2f8sm13304314wmq.17.2023.02.12.23.04.29 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 12 Feb 2023 23:04:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=XKF2b7pEm6HyiNp404lQ+Vuu44DHRtt9tfJtec4bL+4=; b=QtIn3LAs9qg4ypYJ1rswg7/7TrbQIUwUIoZy92VfzbZU+nUWQYJ+1X09W+jxPN9Q4d sqzxS9ih5wldi7jUXfzUTtg3jy2DY2YPatiSxMqstf3vnUIaK9i2/K3p8I1c7UGP4I8u wvQXXGyVTbYqzg7xdJ6xMLh74CCR7QcnKfGv88BuDpwZiAQHxjyCp7bATg8HsYxTV06d dQK150taaucoZ0cIn5gkOFjbmiXiA4+U7KTr5sc1PRVQFTgeOPtKk/ZiCBOacC+7eG7g MetyHak9deDaT8Z+3+OqJhlQr6EVfokCUKOItmXE2PsAZQnS62QQwQEwQo7BSorlAzvb 4xcA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=XKF2b7pEm6HyiNp404lQ+Vuu44DHRtt9tfJtec4bL+4=; b=FNDEICh0+FsUnYxuiHyqj4uwInXUKDnAte5v1/o4VkLMeRIO6d8xRRGzFEsXFCXzhd o99RD3gtt2o6VgJ33msN6iFW57fgnm8nl05rFex82wzu+pSIxmhFu0iumg5oesHnB5P7 bmbh/gHyxT8PLW6Y2wQ+QA99zF53kx4T2L9/dsWNGneB0ql7KOCxOh/8aMmrNopxKn/8 AFLfR2OFZQcgRd8uaMtb4b70jq8t9EDOGnJjlrCn981+OANCIRu47VJpIG74r8I0Z40Z Kby4Wl6zJoru6vIhelbHjZhha6AJ7VE5EnphTvE4euvHM9Lcw/IMuMA/vxi8yLWg/Z3B Lo8g== X-Gm-Message-State: AO0yUKXswQ3DTLI9r3lxFT2FT+HTdKdY84OiWxD1p+XVLMU8qRdREK7p X/ELGHxrzO8Cayg5vglVvXGORx4f6Lo+YCXd X-Google-Smtp-Source: AK7set93mECK5kqoT00VcbS+uhINN6hsaP8kzGHUHdQNGO+wGwZZp3xdtj4Zavda1UB0LigbWWhmcQ== X-Received: by 2002:a05:600c:3087:b0:3df:ea09:fcc9 with SMTP id g7-20020a05600c308700b003dfea09fcc9mr3516386wmn.7.1676271870992; Sun, 12 Feb 2023 23:04:30 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org, Eduardo Habkost Cc: Gonglei Arei , Li Qiang , Cao jin , Hu Tao , qemu-block@nongnu.org, qemu-ppc@nongnu.org, xiaoqiang zhao , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Paolo Bonzini , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PATCH v2 1/9] hw/qdev: Constify DeviceState* argument of qdev_get_parent_bus() Date: Mon, 13 Feb 2023 08:04:15 +0100 Message-Id: <20230213070423.76428-2-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230213070423.76428-1-philmd@linaro.org> References: <20230213070423.76428-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::32e; envelope-from=philmd@linaro.org; helo=mail-wm1-x32e.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1676271961009100001 The structure is accessed read-only by qdev_get_parent_bus(). Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Michael S. Tsirkin --- hw/core/qdev.c | 2 +- include/hw/qdev-core.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/core/qdev.c b/hw/core/qdev.c index d759c4602c..43d863b0c5 100644 --- a/hw/core/qdev.c +++ b/hw/core/qdev.c @@ -330,7 +330,7 @@ bool qdev_machine_modified(void) return qdev_hot_added || qdev_hot_removed; } =20 -BusState *qdev_get_parent_bus(DeviceState *dev) +BusState *qdev_get_parent_bus(const DeviceState *dev) { return dev->parent_bus; } diff --git a/include/hw/qdev-core.h b/include/hw/qdev-core.h index 35fddb19a6..f5b3b2f89a 100644 --- a/include/hw/qdev-core.h +++ b/include/hw/qdev-core.h @@ -715,7 +715,7 @@ static inline void qdev_init_gpio_in_named(DeviceState = *dev, void qdev_pass_gpios(DeviceState *dev, DeviceState *container, const char *name); =20 -BusState *qdev_get_parent_bus(DeviceState *dev); +BusState *qdev_get_parent_bus(const DeviceState *dev); =20 /*** BUS API. ***/ =20 --=20 2.38.1 From nobody Fri May 17 07:56:17 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1676271990; cv=none; d=zohomail.com; s=zohoarc; b=BaIjVVmwawMTmtkHLYSgjSJ+Pcc6R2EgvzvDEZsc5QNCLHPw9+RxkN1DhKn5t92U7tu0bZ6FqBXw1oCavV8XKgZKj/11YTtiHpJn9r7sAdn7Yn+eGDt+FRscMJwmtbC9Myy+wy4FQLntAgWpjCA2teamLeU4IE+UNqH+LxERRJE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1676271990; 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=5i16l2BnG5bR396mqVfBfc0/x+tQE8lt1qXCAB9bxlU=; b=GeVBQwPX1BFCBU9FZ40e6yz9ooidSqF8ByhfTqEki4AvUAGLM4ZQx+JTzosq/h4X8evNkf/ioPeTVjes+BHwxRR+RVpacfes07fgpNfcIlOoFkTzO/sHAd0fXjd5Lu/9tJviJE7sWpuIaJbk6+5/Fuv1s70p0Ewm+8K4Rak5n6o= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 16762719908968.620962749904834; Sun, 12 Feb 2023 23:06:30 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pRStG-0000jp-Gv; Mon, 13 Feb 2023 02:04:42 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pRStD-0000j3-Qp for qemu-devel@nongnu.org; Mon, 13 Feb 2023 02:04:40 -0500 Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pRStC-0000jJ-82 for qemu-devel@nongnu.org; Mon, 13 Feb 2023 02:04:39 -0500 Received: by mail-wm1-x335.google.com with SMTP id n33so1990763wms.0 for ; Sun, 12 Feb 2023 23:04:36 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id ja13-20020a05600c556d00b003dc4b4dea31sm12386835wmb.27.2023.02.12.23.04.34 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 12 Feb 2023 23:04:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=5i16l2BnG5bR396mqVfBfc0/x+tQE8lt1qXCAB9bxlU=; b=EhPR2h+mT0Fu6KYa1KxHWufluoq5JvbKHON0sjpQhXXUGUR8Hwrj3dQ91ekpFgLpWU fW2Hrzgy+qxh3sMW577X9Zlrx+KqHM1orUhbSDN5dS/d4Lpc+PBXSQzPuh2pnwg2eUyB hrJBufZ3MmTwEx6npaFdaW9tH8tLLp/voGcRFO1PLfpHQC2Wz+fryltP2KBUfaR5Hn2A xTgWF5mGmANohXvGXZxmf61VxIcKxWtjCGK7vLNylMARaZW6OsyINEgUHcihleP2bUKn tLkZ6izc5DmaE69ksbX4Ic9m9CACTOJBPy+JihzlgzE2GAMAhhNfCG400OBs/k8morqs RPJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=5i16l2BnG5bR396mqVfBfc0/x+tQE8lt1qXCAB9bxlU=; b=t8oDMSPJqTltJ8YcvsbhVCkjSrIQ5K0Nac01SPaMCToqc97YgnA627r9dsW/TN1KkK VjFKkwtivu67Fgf69BCXljCQUqxYwzA0w3BVJiRegTg9RDCfFSLix0EnoYM9asOwUax6 9Pw8AUh5/Km3i3EFCgddgtvc4DT5K/AGnY17jZ9lKRHpcTL8YFGuXzKRjbKsNmU+DFzV J++dN0MBvv9gwpWM3L+frdG1vt3BmrSadO/fcAVfH/yiHumBYsrN9g0CSBnhlnHmbPaU x6hD31m0cWjLQPv+oQ/qzJTOOskqNkA0WDPfYvZ3QW+/PXtK5VlX9OAWatUYOX3BX7hF Ld4w== X-Gm-Message-State: AO0yUKW0s9TFMmXTFmk6un3LtL9KfmYjan3BvKplJF/XeoFAjsIDY6yl yWA7IMqTyyPZakuEg2PLvSGLrLahbEDYiI38 X-Google-Smtp-Source: AK7set+91wu9eO/3I/3vIKZJ+kxI4mlAVwh9iuP27xWIBUZi0Pe1XIVEdwEouLt2DjeLv0k74P+r7A== X-Received: by 2002:a05:600c:4b1c:b0:3df:eb5d:c583 with SMTP id i28-20020a05600c4b1c00b003dfeb5dc583mr18025496wmp.17.1676271875912; Sun, 12 Feb 2023 23:04:35 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org, Eduardo Habkost Cc: Gonglei Arei , Li Qiang , Cao jin , Hu Tao , qemu-block@nongnu.org, qemu-ppc@nongnu.org, xiaoqiang zhao , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Gerd Hoffmann Subject: [PATCH v2 2/9] hw/audio: Replace dev->parent_bus by qdev_get_parent_bus(dev) Date: Mon, 13 Feb 2023 08:04:16 +0100 Message-Id: <20230213070423.76428-3-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230213070423.76428-1-philmd@linaro.org> References: <20230213070423.76428-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::335; envelope-from=philmd@linaro.org; helo=mail-wm1-x335.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1676271991160100001 DeviceState::parent_bus is an internal field and should be accessed by the qdev_get_parent_bus() helper. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Michael S. Tsirkin --- hw/audio/intel-hda.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/hw/audio/intel-hda.c b/hw/audio/intel-hda.c index b9ed231fe8..ec38828da0 100644 --- a/hw/audio/intel-hda.c +++ b/hw/audio/intel-hda.c @@ -59,7 +59,7 @@ void hda_codec_bus_init(DeviceState *dev, HDACodecBus *bu= s, size_t bus_size, =20 static void hda_codec_dev_realize(DeviceState *qdev, Error **errp) { - HDACodecBus *bus =3D HDA_BUS(qdev->parent_bus); + HDACodecBus *bus =3D HDA_BUS(qdev_get_parent_bus(qdev)); HDACodecDevice *dev =3D HDA_CODEC_DEVICE(qdev); HDACodecDeviceClass *cdc =3D HDA_CODEC_DEVICE_GET_CLASS(dev); =20 @@ -103,14 +103,14 @@ HDACodecDevice *hda_codec_find(HDACodecBus *bus, uint= 32_t cad) =20 void hda_codec_response(HDACodecDevice *dev, bool solicited, uint32_t resp= onse) { - HDACodecBus *bus =3D HDA_BUS(dev->qdev.parent_bus); + HDACodecBus *bus =3D HDA_BUS(qdev_get_parent_bus(DEVICE(dev))); bus->response(dev, solicited, response); } =20 bool hda_codec_xfer(HDACodecDevice *dev, uint32_t stnr, bool output, uint8_t *buf, uint32_t len) { - HDACodecBus *bus =3D HDA_BUS(dev->qdev.parent_bus); + HDACodecBus *bus =3D HDA_BUS(qdev_get_parent_bus(DEVICE(dev))); return bus->xfer(dev, stnr, output, buf, len); } =20 @@ -344,7 +344,7 @@ static void intel_hda_corb_run(IntelHDAState *d) static void intel_hda_response(HDACodecDevice *dev, bool solicited, uint32= _t response) { const MemTxAttrs attrs =3D { .memory =3D true }; - HDACodecBus *bus =3D HDA_BUS(dev->qdev.parent_bus); + HDACodecBus *bus =3D HDA_BUS(qdev_get_parent_bus(DEVICE(dev))); IntelHDAState *d =3D container_of(bus, IntelHDAState, codecs); hwaddr addr; uint32_t wp, ex; @@ -399,7 +399,7 @@ static bool intel_hda_xfer(HDACodecDevice *dev, uint32_= t stnr, bool output, uint8_t *buf, uint32_t len) { const MemTxAttrs attrs =3D MEMTXATTRS_UNSPECIFIED; - HDACodecBus *bus =3D HDA_BUS(dev->qdev.parent_bus); + HDACodecBus *bus =3D HDA_BUS(qdev_get_parent_bus(DEVICE(dev))); IntelHDAState *d =3D container_of(bus, IntelHDAState, codecs); hwaddr addr; uint32_t s, copy, left; --=20 2.38.1 From nobody Fri May 17 07:56:17 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1676272041; cv=none; d=zohomail.com; s=zohoarc; b=UNz2WO8lsJMtvjQ+yz+ut/zrQrXuH6h5GIFeR34ctDogu+7jZ+vM1heKT9x6fzH/VO4LCBj4qJIMb6Lm6rHiexKAhjuZY54m0vBTPZPcQX34xuMpnRBoL8ztxFbnpTN5yxm49NmffIVfFl3nO5jXugPrxxmyLl9jITlWe+ljYg4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1676272041; 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=VqE2ZOIm5Au9FYKFTyho0X2pkszAMeA9vGFnw1NKAis=; b=KIS1FqACYVT9k6/awk5jgsNy1UaoU5/U7mINLDhO8LSPNC+X5t67rspb76atbZj6TBXj92xRej3d5pa9rEoStF9wsoThs+3JrkpzFUXQ4P+fnpYqJCGg9v11M6OYdQaCrHe0aYJAfHLXI9SQwF1stlXFV5yoRqKcQvLdrwqlJM0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1676272041426220.90183241458624; Sun, 12 Feb 2023 23:07:21 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pRStK-0000lK-Ek; Mon, 13 Feb 2023 02:04:46 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pRStJ-0000ko-7l for qemu-devel@nongnu.org; Mon, 13 Feb 2023 02:04:45 -0500 Received: from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pRStG-0000kR-KF for qemu-devel@nongnu.org; Mon, 13 Feb 2023 02:04:44 -0500 Received: by mail-wm1-x32a.google.com with SMTP id z13so8008929wmp.2 for ; Sun, 12 Feb 2023 23:04:42 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id l22-20020a05600c089600b003dc59081603sm12154689wmp.48.2023.02.12.23.04.39 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 12 Feb 2023 23:04:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=VqE2ZOIm5Au9FYKFTyho0X2pkszAMeA9vGFnw1NKAis=; b=XMU6meUAlynnKkP5qFTMYOWQYOL0hR8vRcHqI+wcpVx0c/9dQ3ms/tdWrKIgBIk5wu 1+B6To0xApn9LiwhbIRECFlMDhY17j5EEfV1WWgrOB0Rd1ItKhkVGvUeuhcGLE6ttFSQ 61+01E2jjjeEyoU4tQp3JX3J5kThoUlcn1Wimhd+g2CHUOadFCNjfDTj/Jt9V68xMxav 4QlYjMEsAYO0QguXpP8BdHb6/+NvMYB8mXmkct304zQeDyracqbtlgkFXT+nAb3OSAWh NuoDV+BPHpeOm5VDfzZvyQlkXbRzHZT/CAtS9kXN0xTM6TZEE7FG9HNZcq1odp6uAc4c 3t9Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=VqE2ZOIm5Au9FYKFTyho0X2pkszAMeA9vGFnw1NKAis=; b=JSIdtmZMf9VbJ6tghv6b8vYR9bVheHeDQIoU2UAG98R6BCeUgAt8xI15X20W/cK4RV cYmqPwRv6nCnZHWhk5Jn+UIPhHLN7DD/J5GOSvoGbNBlm9aaCg+WRFDE4A98Vk06jb3+ DEhYWbui+DaHb+B8OmtBhrY1zc9ihXToA1oMbwZDouwtIgynkQYqVjVkXKzv+eAmH/ej QuITbHHxCNEt0WvEzLAPgAMfAAwQm21JFZ900QhS7lnlYGJ3jr1TVnh1WF3PYTUL0lW/ 2Ca0rK+1HL+xykv4wtBtGFurNPPxnX+xD1Jz8uPAZp59QrXdDD3nrDnqqjJu96Hu/RAn kfwQ== X-Gm-Message-State: AO0yUKUyrBO0YV6B8ZqL5cj7sZI1XfQ2ekGpH163mKMRmuxt3oV2EIK7 GvAslJS+pd+S8q1wxrwwsP7vxo2kIi1tlvc2 X-Google-Smtp-Source: AK7set/ON5ssgo8VrJaNMqkRkinMwcBdraGIjiIaTaEtZmbJ0KZ7SGskqEQ2C5whGdSPJ9LvSc5rPg== X-Received: by 2002:a05:600c:16c8:b0:3e0:185:e935 with SMTP id l8-20020a05600c16c800b003e00185e935mr17894509wmn.36.1676271881222; Sun, 12 Feb 2023 23:04:41 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org, Eduardo Habkost Cc: Gonglei Arei , Li Qiang , Cao jin , Hu Tao , qemu-block@nongnu.org, qemu-ppc@nongnu.org, xiaoqiang zhao , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , John Snow , Kevin Wolf , Hanna Reitz , Laurent Vivier , Paolo Bonzini , Fam Zheng Subject: [PATCH v2 3/9] hw/block: Replace dev->parent_bus by qdev_get_parent_bus(dev) Date: Mon, 13 Feb 2023 08:04:17 +0100 Message-Id: <20230213070423.76428-4-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230213070423.76428-1-philmd@linaro.org> References: <20230213070423.76428-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::32a; envelope-from=philmd@linaro.org; helo=mail-wm1-x32a.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1676272043581100015 DeviceState::parent_bus is an internal field and should be accessed by the qdev_get_parent_bus() helper. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Michael S. Tsirkin --- hw/block/fdc.c | 2 +- hw/block/swim.c | 2 +- hw/ide/qdev.c | 6 +++--- hw/scsi/scsi-bus.c | 18 +++++++++--------- include/hw/scsi/scsi.h | 2 +- 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/hw/block/fdc.c b/hw/block/fdc.c index 64ae4a6899..31ad6f6ae0 100644 --- a/hw/block/fdc.c +++ b/hw/block/fdc.c @@ -466,7 +466,7 @@ static Property floppy_drive_properties[] =3D { static void floppy_drive_realize(DeviceState *qdev, Error **errp) { FloppyDrive *dev =3D FLOPPY_DRIVE(qdev); - FloppyBus *bus =3D FLOPPY_BUS(qdev->parent_bus); + FloppyBus *bus =3D FLOPPY_BUS(qdev_get_parent_bus(qdev)); FDrive *drive; bool read_only; int ret; diff --git a/hw/block/swim.c b/hw/block/swim.c index 333da08ce0..64e30e9e80 100644 --- a/hw/block/swim.c +++ b/hw/block/swim.c @@ -157,7 +157,7 @@ static Property swim_drive_properties[] =3D { static void swim_drive_realize(DeviceState *qdev, Error **errp) { SWIMDrive *dev =3D SWIM_DRIVE(qdev); - SWIMBus *bus =3D SWIM_BUS(qdev->parent_bus); + SWIMBus *bus =3D SWIM_BUS(qdev_get_parent_bus(qdev)); FDrive *drive; int ret; =20 diff --git a/hw/ide/qdev.c b/hw/ide/qdev.c index 6f6c7462f3..6ae2627a56 100644 --- a/hw/ide/qdev.c +++ b/hw/ide/qdev.c @@ -81,7 +81,7 @@ static char *idebus_get_fw_dev_path(DeviceState *dev) char path[30]; =20 snprintf(path, sizeof(path), "%s@%x", qdev_fw_name(dev), - ((IDEBus*)dev->parent_bus)->bus_id); + ((IDEBus*)qdev_get_parent_bus(dev))->bus_id); =20 return g_strdup(path); } @@ -90,7 +90,7 @@ static void ide_qdev_realize(DeviceState *qdev, Error **e= rrp) { IDEDevice *dev =3D IDE_DEVICE(qdev); IDEDeviceClass *dc =3D IDE_DEVICE_GET_CLASS(dev); - IDEBus *bus =3D DO_UPCAST(IDEBus, qbus, qdev->parent_bus); + IDEBus *bus =3D DO_UPCAST(IDEBus, qbus, qdev_get_parent_bus(qdev)); =20 if (dev->unit =3D=3D -1) { dev->unit =3D bus->master ? 1 : 0; @@ -164,7 +164,7 @@ typedef struct IDEDrive { =20 static void ide_dev_initfn(IDEDevice *dev, IDEDriveKind kind, Error **errp) { - IDEBus *bus =3D DO_UPCAST(IDEBus, qbus, dev->qdev.parent_bus); + IDEBus *bus =3D DO_UPCAST(IDEBus, qbus, qdev_get_parent_bus(DEVICE(dev= ))); IDEState *s =3D bus->ifs + dev->unit; int ret; =20 diff --git a/hw/scsi/scsi-bus.c b/hw/scsi/scsi-bus.c index ceceafb2cd..7b2a82b335 100644 --- a/hw/scsi/scsi-bus.c +++ b/hw/scsi/scsi-bus.c @@ -104,7 +104,7 @@ static void scsi_device_unrealize(SCSIDevice *s) int scsi_bus_parse_cdb(SCSIDevice *dev, SCSICommand *cmd, uint8_t *buf, size_t buf_len, void *hba_private) { - SCSIBus *bus =3D DO_UPCAST(SCSIBus, qbus, dev->qdev.parent_bus); + SCSIBus *bus =3D DO_UPCAST(SCSIBus, qbus, qdev_get_parent_bus(DEVICE(d= ev))); int rc; =20 assert(cmd->len =3D=3D 0); @@ -250,7 +250,7 @@ static bool scsi_bus_check_address(BusState *qbus, Devi= ceState *qdev, Error **er static void scsi_qdev_realize(DeviceState *qdev, Error **errp) { SCSIDevice *dev =3D SCSI_DEVICE(qdev); - SCSIBus *bus =3D DO_UPCAST(SCSIBus, qbus, dev->qdev.parent_bus); + SCSIBus *bus =3D DO_UPCAST(SCSIBus, qbus, qdev_get_parent_bus(DEVICE(d= ev))); bool is_free; Error *local_err =3D NULL; =20 @@ -705,7 +705,7 @@ SCSIRequest *scsi_req_alloc(const SCSIReqOps *reqops, S= CSIDevice *d, SCSIRequest *scsi_req_new(SCSIDevice *d, uint32_t tag, uint32_t lun, uint8_t *buf, size_t buf_len, void *hba_private) { - SCSIBus *bus =3D DO_UPCAST(SCSIBus, qbus, d->qdev.parent_bus); + SCSIBus *bus =3D DO_UPCAST(SCSIBus, qbus, qdev_get_parent_bus(DEVICE(d= ))); const SCSIReqOps *ops; SCSIDeviceClass *sc =3D SCSI_DEVICE_GET_CLASS(d); SCSIRequest *req; @@ -1353,7 +1353,7 @@ int scsi_req_parse_cdb(SCSIDevice *dev, SCSICommand *= cmd, uint8_t *buf, =20 void scsi_device_report_change(SCSIDevice *dev, SCSISense sense) { - SCSIBus *bus =3D DO_UPCAST(SCSIBus, qbus, dev->qdev.parent_bus); + SCSIBus *bus =3D DO_UPCAST(SCSIBus, qbus, qdev_get_parent_bus(DEVICE(d= ev))); =20 scsi_device_set_ua(dev, sense); if (bus->info->change) { @@ -1372,7 +1372,7 @@ void scsi_req_unref(SCSIRequest *req) { assert(req->refcount > 0); if (--req->refcount =3D=3D 0) { - BusState *qbus =3D req->dev->qdev.parent_bus; + BusState *qbus =3D qdev_get_parent_bus(DEVICE(req->dev)); SCSIBus *bus =3D DO_UPCAST(SCSIBus, qbus, qbus); =20 if (bus->info->free_request && req->hba_private) { @@ -1444,7 +1444,7 @@ void scsi_req_print(SCSIRequest *req) int i; =20 fprintf(fp, "[%s id=3D%d] %s", - req->dev->qdev.parent_bus->name, + qdev_get_parent_bus(DEVICE(req->dev))->name, req->dev->id, scsi_command_name(req->cmd.buf[0])); for (i =3D 1; i < req->cmd.len; i++) { @@ -1671,7 +1671,7 @@ void scsi_device_purge_requests(SCSIDevice *sdev, SCS= ISense sense) static char *scsibus_get_dev_path(DeviceState *dev) { SCSIDevice *d =3D SCSI_DEVICE(dev); - DeviceState *hba =3D dev->parent_bus->parent; + DeviceState *hba =3D qdev_get_parent_bus(dev)->parent; char *id; char *path; =20 @@ -1698,7 +1698,7 @@ static int put_scsi_requests(QEMUFile *f, void *pv, s= ize_t size, const VMStateField *field, JSONWriter *vmdesc) { SCSIDevice *s =3D pv; - SCSIBus *bus =3D DO_UPCAST(SCSIBus, qbus, s->qdev.parent_bus); + SCSIBus *bus =3D DO_UPCAST(SCSIBus, qbus, qdev_get_parent_bus(DEVICE(s= ))); SCSIRequest *req; =20 QTAILQ_FOREACH(req, &s->requests, next) { @@ -1726,7 +1726,7 @@ static int get_scsi_requests(QEMUFile *f, void *pv, s= ize_t size, const VMStateField *field) { SCSIDevice *s =3D pv; - SCSIBus *bus =3D DO_UPCAST(SCSIBus, qbus, s->qdev.parent_bus); + SCSIBus *bus =3D DO_UPCAST(SCSIBus, qbus, qdev_get_parent_bus(DEVICE(s= ))); int8_t sbyte; =20 while ((sbyte =3D qemu_get_sbyte(f)) > 0) { diff --git a/include/hw/scsi/scsi.h b/include/hw/scsi/scsi.h index 6ea4b64fe7..843dde8851 100644 --- a/include/hw/scsi/scsi.h +++ b/include/hw/scsi/scsi.h @@ -177,7 +177,7 @@ static inline void scsi_bus_init(SCSIBus *bus, size_t b= us_size, =20 static inline SCSIBus *scsi_bus_from_device(SCSIDevice *d) { - return DO_UPCAST(SCSIBus, qbus, d->qdev.parent_bus); + return DO_UPCAST(SCSIBus, qbus, qdev_get_parent_bus(DEVICE(d))); } =20 SCSIDevice *scsi_bus_legacy_add_drive(SCSIBus *bus, BlockBackend *blk, --=20 2.38.1 From nobody Fri May 17 07:56:17 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1676272038; cv=none; d=zohomail.com; s=zohoarc; b=NlrLc06eGL6+s6k9p7zBe5v94/0bfAWk7Gy8t0s4/cbDRPfkKCLKVTrneqWeAD/0q3zwn7+/ybn5OuzAOiUvXCFdiHJ3XVFhb/6Rt/ijCLlJVUUsxRqtzcMtr2EFouHxmi2RT4r9WkD5+fAb+kE3Ag2g3aGU7qtfIdthqQ2xWV0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1676272038; 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=Jz/OlZ7doHa0+NAa3PesX+R44gnSBsZj1QZteHGnoxI=; b=m64VbRUwRFn1cMxcw0uO5yJqX0RHFVhmZzqebhktrWkki/X7WOcnlZ6abhDjptYAQ6WImlCycC4+4XA1k9typhV3zKGEVQSE9R6AppdZOnGUO/zupJjTfBThOOFzq35XgNoCls7MamEjL/C2kwV9T91FGcZjdCIGMC2lj/EZYsg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1676272038337412.6923258848824; Sun, 12 Feb 2023 23:07:18 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pRStP-0000nc-Af; Mon, 13 Feb 2023 02:04:51 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pRStN-0000mQ-Bt for qemu-devel@nongnu.org; Mon, 13 Feb 2023 02:04:49 -0500 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pRStL-0000le-QV for qemu-devel@nongnu.org; Mon, 13 Feb 2023 02:04:49 -0500 Received: by mail-wm1-x32f.google.com with SMTP id az4-20020a05600c600400b003dff767a1f1so8224235wmb.2 for ; Sun, 12 Feb 2023 23:04:47 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id r14-20020a05600c35ce00b003dc4ecfc4d7sm13827394wmq.29.2023.02.12.23.04.45 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 12 Feb 2023 23:04:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Jz/OlZ7doHa0+NAa3PesX+R44gnSBsZj1QZteHGnoxI=; b=PaneiVAgygXpNEZZOPRCvF44cqCZnBm4lAjQlFA7KxLHym9zhssUcmma3K9w6WgrkF 5b7iQIfY1i2jULxJXuP/JqffoyftFHNt7145tv8p0DH7nvfhTmb+fl3tFCuRRsWbXSf8 A5MzBFSj5NUV1wt+TGbdN5382meYuQy91QwJpvnVs4Yd1w+tfsjrBwDqPSd+wNh7fmOy r/KQ7uufc/2hne4vq1EB6F8/efc9Gx2Yhr29uQh9q4zjAMJlzdmzM8MRmUtK1BlPLx1q dFqY3UyhSX6sBaJd75E9mBvMEikHjzBADG+LNSiNCsVcQ1Prqe1ZUBtTnMnc69kuiaLS 1prA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Jz/OlZ7doHa0+NAa3PesX+R44gnSBsZj1QZteHGnoxI=; b=RZWRVS2Ot8mjCNqr8cDZfZeswVh80hXfUokp4wfCygY1/WgHJxzEcAx5G4+m1lECmm z3OI9KBZ8hF8PxHZgaeBwJcqx41+kHcXXiZi0pSVxEPtiQvZPJbNL6LERncvYuAWG8OI xBNiHOxtJFBWVh6sODT7XHJl/scEyolj1AIu39BY8Bh/iNyoob7fi7TRQplVR9+ImPnz NRSfVME8dEWHRtwI+pzNGJl0TfRxr1YW1ck1AUcIyAi0al6Ed7cKFxgCm1xBcahE+5WQ BON0cLxXGDpBq2qaZo8tVk7wiLbpUfk20ITUh9nVN5uWSaQnIM62zAZAVPKHCMe6T7B6 snrg== X-Gm-Message-State: AO0yUKX9vTZ8ucgon4ivFh6Mhf0IJ9nKYqWpnBuooxMvTsJNC0YZjyLW lyFzgCwQRDWudO69UtRPg35wFiV8vpEPOakQ X-Google-Smtp-Source: AK7set9NOkotw/QoFo5sY7z8laTN8K8WO97o270ohMOMUr5vwGeFZWSa8vzODEYq6aLIscjOcyKEmw== X-Received: by 2002:a05:600c:16c4:b0:3df:f71b:3f68 with SMTP id l4-20020a05600c16c400b003dff71b3f68mr17867842wmn.39.1676271886311; Sun, 12 Feb 2023 23:04:46 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org, Eduardo Habkost Cc: Gonglei Arei , Li Qiang , Cao jin , Hu Tao , qemu-block@nongnu.org, qemu-ppc@nongnu.org, xiaoqiang zhao , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , "Michael S. Tsirkin" , Jason Wang Subject: [PATCH v2 4/9] hw/net: Replace dev->parent_bus by qdev_get_parent_bus(dev) Date: Mon, 13 Feb 2023 08:04:18 +0100 Message-Id: <20230213070423.76428-5-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230213070423.76428-1-philmd@linaro.org> References: <20230213070423.76428-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::32f; envelope-from=philmd@linaro.org; helo=mail-wm1-x32f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1676272039489100001 DeviceState::parent_bus is an internal field and should be accessed by the qdev_get_parent_bus() helper. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Acked-by: Michael S. Tsirkin Reviewed-by: Michael S. Tsirkin --- hw/net/virtio-net.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c index 3ae909041a..8bc160ab59 100644 --- a/hw/net/virtio-net.c +++ b/hw/net/virtio-net.c @@ -3423,7 +3423,7 @@ static bool failover_replug_primary(VirtIONet *n, Dev= iceState *dev, if (!pdev->partially_hotplugged) { return true; } - primary_bus =3D dev->parent_bus; + primary_bus =3D qdev_get_parent_bus(dev); if (!primary_bus) { error_setg(errp, "virtio_net: couldn't find primary bus"); return false; --=20 2.38.1 From nobody Fri May 17 07:56:17 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1676271934; cv=none; d=zohomail.com; s=zohoarc; b=kBfx0c62XBA8FusiTlx1wv9eQlJRXRGMpfjg6z3RKveDF2kyeVXY2wnjrGpGSreRQnWra4fxEWI317ljhFltFRa/ziUNCNQgP6qLJJCToDY4NYv8kWJ/meBqAaeG1McUhI4eqoidt4wO8pSI0zLRxuTs4yV2VrluZRYflJ9NkSc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1676271934; 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=5xw6YWbqYTi/Ye8J2dXQn81KMiMRy7Drw2jaWnSC+88=; b=ZJFgeMSUbX3HwBIrZihhxutwFAm6kjXlMik4RhLuhzPac+9f4jwpu3Yl8CdlQONNnZqvb2qkU7yTXOAqO8Mt2ITpMTNP2dAME9XiYMzLkPcjxM/Re/GZY3u3W0iHMnVIThbR1BZc9zNBC2m61EzpNKEgiEnp175ZH9noFauJZB4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1676271934474543.0353132495208; Sun, 12 Feb 2023 23:05:34 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pRStU-0000oy-3X; Mon, 13 Feb 2023 02:04:56 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pRStS-0000o9-U8 for qemu-devel@nongnu.org; Mon, 13 Feb 2023 02:04:54 -0500 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pRStR-0000mm-5C for qemu-devel@nongnu.org; Mon, 13 Feb 2023 02:04:54 -0500 Received: by mail-wm1-x334.google.com with SMTP id n13so7993863wmr.4 for ; Sun, 12 Feb 2023 23:04:52 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id az10-20020a05600c600a00b003dc3f07c876sm16543292wmb.46.2023.02.12.23.04.50 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 12 Feb 2023 23:04:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=5xw6YWbqYTi/Ye8J2dXQn81KMiMRy7Drw2jaWnSC+88=; b=ioPYMvi68OXe3G4515y+qHdHiDU8Fhk1Fr7O9At1ahbzlE27TqKTifQOxvdKmuqEwT oaMkcU6hWZZtlfE67Nggeg47hsr1IiK3hhaV4LNg9X3JAb0HyM51fB34/8wpGziQVuxo kp7fsFt83eOJ+h+QVlG3T690LJx6dzR3qeLbif9Pg3AkeNaCQ4eOs07V20DpiqJ5XN62 r2R34eJbqILz0O8naTtPLKXmb8D9YDyo3OuJhYunaeLTqRKbHYh1aDCSqgq0dOwmSam0 MviowIQph6WrPn4tb363rpSJNDZwyK9kIG3aHrN8lCJQgv4W2akFfafsvE60yy4se+0w BRCQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=5xw6YWbqYTi/Ye8J2dXQn81KMiMRy7Drw2jaWnSC+88=; b=E1Gw2i7uizEdiJ6nU8ZLwS2ZHo4oG4TedjJL/ewwjjEsWquMl76GGWNu6hgR6MGM0l XqIpsgdEDpj8c1TWOUc38l6lQnA6D7OdCl3QXE0+9ACSessQIBPs/yWfHEBI5aRACCQp LjS6C4y6JFVb4AJB68KCdye84pw3Co3rapo/eHmY35TIl17jIhroXkYz4wHMa/YNZSOS RPJ92Rw/7O2QgxSp2vgUVwPiwwRd478Kx7hCgEhOGwkzcr6iXxm8vnPehsqTFw9+8svL MSVqY0hbvyUEDFH2kTlmAJFgitHgHOntfL5ycXP600AnImvmTRaq8dnzyArnC85ULUy2 MQ4Q== X-Gm-Message-State: AO0yUKVoSfuvN/ZW0mTQkAwLVktAUFJ0tXRFRw8El/JQZdPt/Cdj/Mh2 caxxZ54tItstOCZlOyj+rVcAN9BbYtO2vJF1 X-Google-Smtp-Source: AK7set8cwylg4ojUMzs2HVrufnV579dAZnrv+noo9OVylwZLCmnAyTCkMvBHASFlwqc5XHyC3kqwzQ== X-Received: by 2002:a05:600c:810:b0:3df:f7e7:5f01 with SMTP id k16-20020a05600c081000b003dff7e75f01mr17762961wmp.15.1676271891413; Sun, 12 Feb 2023 23:04:51 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org, Eduardo Habkost Cc: Gonglei Arei , Li Qiang , Cao jin , Hu Tao , qemu-block@nongnu.org, qemu-ppc@nongnu.org, xiaoqiang zhao , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , "Michael S. Tsirkin" , Marcel Apfelbaum Subject: [PATCH v2 5/9] hw/pci: Replace dev->parent_bus by qdev_get_parent_bus(dev) Date: Mon, 13 Feb 2023 08:04:19 +0100 Message-Id: <20230213070423.76428-6-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230213070423.76428-1-philmd@linaro.org> References: <20230213070423.76428-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::334; envelope-from=philmd@linaro.org; helo=mail-wm1-x334.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1676271935533100001 DeviceState::parent_bus is an internal field and should be accessed by the qdev_get_parent_bus() helper. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Acked-by: Michael S. Tsirkin Reviewed-by: Michael S. Tsirkin --- hw/pci-bridge/pci_expander_bridge.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/pci-bridge/pci_expander_bridge.c b/hw/pci-bridge/pci_expand= er_bridge.c index e752a21292..8c0649c071 100644 --- a/hw/pci-bridge/pci_expander_bridge.c +++ b/hw/pci-bridge/pci_expander_bridge.c @@ -151,7 +151,7 @@ static char *pxb_host_ofw_unit_address(const SysBusDevi= ce *dev) assert(position >=3D 0); =20 pxb_dev_base =3D DEVICE(pxb_dev); - main_host =3D PCI_HOST_BRIDGE(pxb_dev_base->parent_bus->parent); + main_host =3D PCI_HOST_BRIDGE(qdev_get_parent_bus(pxb_dev_base)->paren= t); main_host_sbd =3D SYS_BUS_DEVICE(main_host); =20 if (main_host_sbd->num_mmio > 0) { --=20 2.38.1 From nobody Fri May 17 07:56:17 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1676271960; cv=none; d=zohomail.com; s=zohoarc; b=S4DFAEZY3n2K96/VzUaMTCYlUfl4sI6b3SUY6j/9LNM2kvgs5PqBUNH1qEfL0XLnLA5ORx9uaOR7k4M632zBc0BLkgP2Djw8crPnYX7Nh1xpYBp3Z3H+hsyFQvO3BM66dSj0VKuPAB0vgcklY+BMaI0TxRAQgNfLqvmMArbIKdo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1676271960; 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=nNOrNrdb50vLty1kgJSdCEtWYQ6pUAsz/+ttGOyu3ag=; b=AvCZRdv9ob8Y8PQppuwGR2KMenrHJ9oaXinQsRq7GlctCarNcLr3yP4gS3kZNMw3OaiQ4Amn0IHO8n8l5lnx++kjL/E/3Jpj1zKJju0Yka2iLz1d2ZMJiPWDmMe7qw1Ql0Wv1MtYUeMeDv1dx48VkoYLoRpOg2j9vxnXXLZH0jw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1676271960380975.7551248563568; Sun, 12 Feb 2023 23:06:00 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pRStZ-0000rQ-Tc; Mon, 13 Feb 2023 02:05:01 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pRStY-0000qU-4a for qemu-devel@nongnu.org; Mon, 13 Feb 2023 02:05:00 -0500 Received: from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pRStV-0000ns-Vw for qemu-devel@nongnu.org; Mon, 13 Feb 2023 02:04:59 -0500 Received: by mail-wm1-x32a.google.com with SMTP id o36so8015208wms.1 for ; Sun, 12 Feb 2023 23:04:57 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id b4-20020a5d4b84000000b002c55b0e6ef1sm898198wrt.4.2023.02.12.23.04.55 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 12 Feb 2023 23:04:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=nNOrNrdb50vLty1kgJSdCEtWYQ6pUAsz/+ttGOyu3ag=; b=SZHeQUxGMDunui3vw8GbRBp2K6OJj7AhQjfieEKKfFX6Jh6WyOhDwwLM6E138+r/Sm FOlx470IuAt4B/YPjUOjlipTzIYeIH2y6whKsyNuRBVjUsZj+4HRuasR+hy3ofB9JRu5 KA/XmDQBqFiv6O34KMyhR9gM+tiHmVf3tcWyvPnpZTXxrjFiW1C2JTxecAMSVF2zS0SW OQksu7q8KH999s8VAu8D3uCrKsyqMi2OzAcTbs2Fd/+EgJYOYQ5cwd/ocXWivPoNHErI ZviqzSgKRk1v11YYFpySihX8TpRPaXCPjOgSVCzF3hAbLw1gwQvwmJybzCDdeU+CZNMS DI+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=nNOrNrdb50vLty1kgJSdCEtWYQ6pUAsz/+ttGOyu3ag=; b=VhhevZaEho6uSXpm0OMQh969ou3maDnFOZuZJgsD7SWKdp7AiHOqZAh8s1u5YretTZ EaEksV+8nW3lweFu5ycTsVbGVAtJP9ZD6T05c8DoeHe+1MWdxmg1JgFvl0fRqG2dK77B 9z3yWmgtfb/+0JO0O0ZMcMzPlPsLWfctHCWkaesFiyrmJFSHtEuutF18ieqSg5PgCVDr 0f23xgwu//eyAyRMUfz8X8cs2Rcc4mDkB9EKU378H5lipxqe7hjvn4i8JshzT+o7rnEn 5Rfrc8/Y7xVWys3FRslIUOu1ir3U5ABI61VPnLdrLgRFOpHWOgT3ic+fGjmus+ScvgzB Ufhw== X-Gm-Message-State: AO0yUKVvJGC3JvqIdf3haGnRUP5IYHFGkqBl21rrAMZoMQUIHC+wNfAz l1wwqem2Z4Oih8MLzuc/S0V+ItLw/LaAqrbO X-Google-Smtp-Source: AK7set9MuLpv9q4isPoFGFGtbTrnMgw9fqslmrA706l9Z6w23PH9VVqUiqBY2VN8CQfun7Jgp6DseA== X-Received: by 2002:a05:600c:3b92:b0:3df:eedf:df1c with SMTP id n18-20020a05600c3b9200b003dfeedfdf1cmr22149527wms.38.1676271896498; Sun, 12 Feb 2023 23:04:56 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org, Eduardo Habkost Cc: Gonglei Arei , Li Qiang , Cao jin , Hu Tao , qemu-block@nongnu.org, qemu-ppc@nongnu.org, xiaoqiang zhao , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Daniel Henrique Barboza , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , David Gibson , Greg Kurz Subject: [PATCH v2 6/9] hw/ppc: Replace dev->parent_bus by qdev_get_parent_bus(dev) Date: Mon, 13 Feb 2023 08:04:20 +0100 Message-Id: <20230213070423.76428-7-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230213070423.76428-1-philmd@linaro.org> References: <20230213070423.76428-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::32a; envelope-from=philmd@linaro.org; helo=mail-wm1-x32a.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1676271961060100003 DeviceState::parent_bus is an internal field and should be accessed by the qdev_get_parent_bus() helper. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: C=C3=A9dric Le Goater Reviewed-by: Michael S. Tsirkin --- hw/ppc/spapr_vio.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/ppc/spapr_vio.c b/hw/ppc/spapr_vio.c index 9d4fec2c04..dfc5c436bd 100644 --- a/hw/ppc/spapr_vio.c +++ b/hw/ppc/spapr_vio.c @@ -382,7 +382,7 @@ static void rtas_quiesce(PowerPCCPU *cpu, SpaprMachineS= tate *spapr, =20 static SpaprVioDevice *reg_conflict(SpaprVioDevice *dev) { - SpaprVioBus *bus =3D SPAPR_VIO_BUS(dev->qdev.parent_bus); + SpaprVioBus *bus =3D SPAPR_VIO_BUS(qdev_get_parent_bus(DEVICE(dev))); BusChild *kid; SpaprVioDevice *other; =20 @@ -492,7 +492,7 @@ static void spapr_vio_busdev_realize(DeviceState *qdev,= Error **errp) } } else { /* Need to assign an address */ - SpaprVioBus *bus =3D SPAPR_VIO_BUS(dev->qdev.parent_bus); + SpaprVioBus *bus =3D SPAPR_VIO_BUS(qdev_get_parent_bus(DEVICE(dev)= )); =20 do { dev->reg =3D bus->next_reg++; --=20 2.38.1 From nobody Fri May 17 07:56:17 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1676272027; cv=none; d=zohomail.com; s=zohoarc; b=e6ua6BVoEM5M60wPXuJYp6pTGtS0xZcnUpvWcOzAmZPp4CGX3xXqfWd/PM8RUBI9ZdMdg5oyNG5wnlCgNfwhf4K6aM97n0mm6O+3grRZAioUQ1rNukSgyb4MADq617izSg+rangnzX1fQYLLrrkDqwsIgv60idkh10iRzVHp6i0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1676272027; 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=XdMMeyLfgOiIuUSYaAinlqjnLYWjeQ0Zs9Y9OR16Myc=; b=EWIKTSH9najefQyOx8UrvCExv7ZesVTlxsOo0xn4krriXnKTM4gX//abQpC3RbbYlCxYol0MBmfRnNhdNd4PnnIoTgCVkGwKJ2ueCogi8gRsghbATS/rn0unzegFhatrD9eLQbjAV2wmaHTVFd9vXeaAfMBO3KlQnrEb+HqpmFg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1676272027909925.0434199579048; Sun, 12 Feb 2023 23:07:07 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pRSti-0000sd-2O; Mon, 13 Feb 2023 02:05:10 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pRSte-0000rw-D3 for qemu-devel@nongnu.org; Mon, 13 Feb 2023 02:05:06 -0500 Received: from mail-wr1-x433.google.com ([2a00:1450:4864:20::433]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pRStb-0000pU-GE for qemu-devel@nongnu.org; Mon, 13 Feb 2023 02:05:05 -0500 Received: by mail-wr1-x433.google.com with SMTP id y1so11059342wru.2 for ; Sun, 12 Feb 2023 23:05:02 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id x1-20020adfffc1000000b002425be3c9e2sm9802213wrs.60.2023.02.12.23.05.00 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 12 Feb 2023 23:05:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=XdMMeyLfgOiIuUSYaAinlqjnLYWjeQ0Zs9Y9OR16Myc=; b=JLLUVRVfJNoI/olAOO74QuU1o6vbv+ZhCNjG86s63vEHXyfUK1OFwqcaPUVkmGIkVf qlsA73BEJyuA5Z6DT8RlP0MhN9hxpCtk9WExHO+G+Sum5vtG++bFHaMKiYkNTuym9ijJ EoQaG51NuAhjthQcv5mI2dk7Dq0oL7B8PED1CmSrKgaSSGAu9SvHF6FSdTGP7LMgz3KX 9CiXQFMfMZv69a8eGk7lBeR4KajykK4osJWhhfx3FY+UyW5n7kTgUZdQFPSILqNEZMh1 eiGO2VAp6xJ3fWTqU4iNpWjOxacgH6M6khZb7vaq1NZ7cP6rpDJ670915tKHopAaMw5X xk3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=XdMMeyLfgOiIuUSYaAinlqjnLYWjeQ0Zs9Y9OR16Myc=; b=Qv+O652/WLAcIL9NBD96u27SSKU/j2cJeM9siFdNlqyR3Oj2Bfgtnx5TTdmMYqnaIx T6S3GI+NUhko0xnUh6TdEsdhZowgcwjpzBqY57WPKLizDnNqH2aQYM6dAiEudW2sRDOA 4HsIYtopSeNIJtZf7DrBss3URfhS+xK/Y3jwHwcL2JkjDFl/wjK6MosAqdjD4UeIEuCT 3cmr6iv9omQ+JQkgPN4E2RknivYvmJFf7TOIdiI8TM31BWTky7cWJs2W15hQAKy+ZXGQ Zt8n2RoxdeioxJomEdgxF1e3keyf1Fg5pNPU4R1HUfNsGgacKx55wuVH9um2OrIZ4CrU LSkg== X-Gm-Message-State: AO0yUKVeDlz1Nw1nuBEV7BRx6IFjBCOmA6pvSIsuElPlIeabvM8eJqeZ rJu9kau/JJfiUdwIEP5OAtoYTX0UkS8Os7ev X-Google-Smtp-Source: AK7set8DM2vlmLPrgwDNOTQk1ZpMElKSlHgXUsAcFzX610HnUhyxivLnWvbzvDdYlOi31KYFz4WuGQ== X-Received: by 2002:a5d:4e4b:0:b0:2c3:e6b8:8cec with SMTP id r11-20020a5d4e4b000000b002c3e6b88cecmr19204061wrt.49.1676271901638; Sun, 12 Feb 2023 23:05:01 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org, Eduardo Habkost Cc: Gonglei Arei , Li Qiang , Cao jin , Hu Tao , qemu-block@nongnu.org, qemu-ppc@nongnu.org, xiaoqiang zhao , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Gerd Hoffmann Subject: [PATCH v2 7/9] hw/usb: Replace dev->parent_bus by qdev_get_parent_bus(dev) Date: Mon, 13 Feb 2023 08:04:21 +0100 Message-Id: <20230213070423.76428-8-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230213070423.76428-1-philmd@linaro.org> References: <20230213070423.76428-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::433; envelope-from=philmd@linaro.org; helo=mail-wr1-x433.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1676272029382100001 DeviceState::parent_bus is an internal field and should be accessed by the qdev_get_parent_bus() helper. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Michael S. Tsirkin --- hw/usb/bus.c | 2 +- hw/usb/desc.c | 2 +- hw/usb/dev-smartcard-reader.c | 16 ++++++++-------- include/hw/usb.h | 2 +- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/hw/usb/bus.c b/hw/usb/bus.c index 92d6ed5626..d7c3c71435 100644 --- a/hw/usb/bus.c +++ b/hw/usb/bus.c @@ -595,7 +595,7 @@ static void usb_bus_dev_print(Monitor *mon, DeviceState= *qdev, int indent) static char *usb_get_dev_path(DeviceState *qdev) { USBDevice *dev =3D USB_DEVICE(qdev); - DeviceState *hcd =3D qdev->parent_bus->parent; + DeviceState *hcd =3D qdev_get_parent_bus(qdev)->parent; char *id =3D qdev_get_dev_path(hcd); =20 if (id) { diff --git a/hw/usb/desc.c b/hw/usb/desc.c index 7f6cc2f99b..2646515e26 100644 --- a/hw/usb/desc.c +++ b/hw/usb/desc.c @@ -553,7 +553,7 @@ void usb_desc_set_string(USBDevice *dev, uint8_t index,= const char *str) */ void usb_desc_create_serial(USBDevice *dev) { - DeviceState *hcd =3D dev->qdev.parent_bus->parent; + DeviceState *hcd =3D qdev_get_parent_bus(DEVICE(dev))->parent; const USBDesc *desc =3D usb_device_get_usb_desc(dev); int index =3D desc->id.iSerialNumber; char *path, *serial; diff --git a/hw/usb/dev-smartcard-reader.c b/hw/usb/dev-smartcard-reader.c index 28164d89be..5e94b4f64a 100644 --- a/hw/usb/dev-smartcard-reader.c +++ b/hw/usb/dev-smartcard-reader.c @@ -1187,7 +1187,7 @@ void ccid_card_send_apdu_to_guest(CCIDCardState *card, uint8_t *apdu, uint32_t len) { DeviceState *qdev =3D DEVICE(card); - USBDevice *dev =3D USB_DEVICE(qdev->parent_bus->parent); + USBDevice *dev =3D USB_DEVICE(qdev_get_parent_bus(qdev)->parent); USBCCIDState *s =3D USB_CCID_DEV(dev); Answer *answer; =20 @@ -1210,7 +1210,7 @@ void ccid_card_send_apdu_to_guest(CCIDCardState *card, void ccid_card_card_removed(CCIDCardState *card) { DeviceState *qdev =3D DEVICE(card); - USBDevice *dev =3D USB_DEVICE(qdev->parent_bus->parent); + USBDevice *dev =3D USB_DEVICE(qdev_get_parent_bus(qdev)->parent); USBCCIDState *s =3D USB_CCID_DEV(dev); =20 ccid_on_slot_change(s, false); @@ -1221,7 +1221,7 @@ void ccid_card_card_removed(CCIDCardState *card) int ccid_card_ccid_attach(CCIDCardState *card) { DeviceState *qdev =3D DEVICE(card); - USBDevice *dev =3D USB_DEVICE(qdev->parent_bus->parent); + USBDevice *dev =3D USB_DEVICE(qdev_get_parent_bus(qdev)->parent); USBCCIDState *s =3D USB_CCID_DEV(dev); =20 DPRINTF(s, 1, "CCID Attach\n"); @@ -1231,7 +1231,7 @@ int ccid_card_ccid_attach(CCIDCardState *card) void ccid_card_ccid_detach(CCIDCardState *card) { DeviceState *qdev =3D DEVICE(card); - USBDevice *dev =3D USB_DEVICE(qdev->parent_bus->parent); + USBDevice *dev =3D USB_DEVICE(qdev_get_parent_bus(qdev)->parent); USBCCIDState *s =3D USB_CCID_DEV(dev); =20 DPRINTF(s, 1, "CCID Detach\n"); @@ -1244,7 +1244,7 @@ void ccid_card_ccid_detach(CCIDCardState *card) void ccid_card_card_error(CCIDCardState *card, uint64_t error) { DeviceState *qdev =3D DEVICE(card); - USBDevice *dev =3D USB_DEVICE(qdev->parent_bus->parent); + USBDevice *dev =3D USB_DEVICE(qdev_get_parent_bus(qdev)->parent); USBCCIDState *s =3D USB_CCID_DEV(dev); =20 s->bmCommandStatus =3D COMMAND_STATUS_FAILED; @@ -1263,7 +1263,7 @@ void ccid_card_card_error(CCIDCardState *card, uint64= _t error) void ccid_card_card_inserted(CCIDCardState *card) { DeviceState *qdev =3D DEVICE(card); - USBDevice *dev =3D USB_DEVICE(qdev->parent_bus->parent); + USBDevice *dev =3D USB_DEVICE(qdev_get_parent_bus(qdev)->parent); USBCCIDState *s =3D USB_CCID_DEV(dev); =20 s->bmCommandStatus =3D COMMAND_STATUS_NO_ERROR; @@ -1275,7 +1275,7 @@ static void ccid_card_unrealize(DeviceState *qdev) { CCIDCardState *card =3D CCID_CARD(qdev); CCIDCardClass *cc =3D CCID_CARD_GET_CLASS(card); - USBDevice *dev =3D USB_DEVICE(qdev->parent_bus->parent); + USBDevice *dev =3D USB_DEVICE(qdev_get_parent_bus(qdev)->parent); USBCCIDState *s =3D USB_CCID_DEV(dev); =20 if (ccid_card_inserted(s)) { @@ -1291,7 +1291,7 @@ static void ccid_card_realize(DeviceState *qdev, Erro= r **errp) { CCIDCardState *card =3D CCID_CARD(qdev); CCIDCardClass *cc =3D CCID_CARD_GET_CLASS(card); - USBDevice *dev =3D USB_DEVICE(qdev->parent_bus->parent); + USBDevice *dev =3D USB_DEVICE(qdev_get_parent_bus(qdev)->parent); USBCCIDState *s =3D USB_CCID_DEV(dev); Error *local_err =3D NULL; =20 diff --git a/include/hw/usb.h b/include/hw/usb.h index 32c23a5ca2..b2111bb1c7 100644 --- a/include/hw/usb.h +++ b/include/hw/usb.h @@ -520,7 +520,7 @@ void usb_check_attach(USBDevice *dev, Error **errp); =20 static inline USBBus *usb_bus_from_device(USBDevice *d) { - return DO_UPCAST(USBBus, qbus, d->qdev.parent_bus); + return DO_UPCAST(USBBus, qbus, qdev_get_parent_bus(DEVICE(d))); } =20 extern const VMStateDescription vmstate_usb_device; --=20 2.38.1 From nobody Fri May 17 07:56:17 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1676272040; cv=none; d=zohomail.com; s=zohoarc; b=InP6nIvO/YPQuhwkcVW9P/FGGSp3nECM/M12ZvQ/13hpd/fp3ZsbpZSM+1R1u3A/6p06QerHjbBcbziLcvcxVDZloh4E9M494zsDGCh7cwNxFTsE20K2GHhPWehZYHNroASxvkrGlOEWSURbSzUh1tNGTyeDAf/5unZJrC7sTAw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1676272040; 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=9E9FEd3Tu+4S+Gw8JExKzSs7Qwdz1/Mjy+Z3v6Jr7cU=; b=PMc5r6Lk3ubeFuCmftFoGxP6nDddrQTkS5L7pRJfqSw/DdIm7Cc9d9X9qUfL4ZkrQSbL3GJrWrC7jQF3VWiDx6UDCdpy0Ui2MQJuk9M31O1dibvR9U3q5DxmBgtI553YgEk/i/LxdSO0tBcd1gZ206p2YOw3N/cHY4078bj+jcs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1676272040382132.60606056980225; Sun, 12 Feb 2023 23:07:20 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pRStl-00013J-Aa; Mon, 13 Feb 2023 02:05:13 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pRSti-0000wV-To for qemu-devel@nongnu.org; Mon, 13 Feb 2023 02:05:11 -0500 Received: from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pRStg-0000rN-FE for qemu-devel@nongnu.org; Mon, 13 Feb 2023 02:05:10 -0500 Received: by mail-wm1-x32a.google.com with SMTP id m16-20020a05600c3b1000b003dc4050c94aso8210627wms.4 for ; Sun, 12 Feb 2023 23:05:07 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id s21-20020a1cf215000000b003e001119927sm15611430wmc.24.2023.02.12.23.05.05 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 12 Feb 2023 23:05:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=9E9FEd3Tu+4S+Gw8JExKzSs7Qwdz1/Mjy+Z3v6Jr7cU=; b=bUUnjBSKzaRsrleogEo75EbxRP6nFkA33ZkVb0a9Mhmk9OZl3oym4PiEzotXZEHc8g HlxuIPXznNfvKKzfAlaGln5xNZ1W4zwcrp4PinxtlJvwdB8llWyCW245l/4gPRvDgchn lxRgt/SAk2lt0yC/vscwHXq36GauRbUuvTTh0JIA9fI3nsjsksPzG3YZp2C2t6GEfRpo qVCarLZDmIlRU3kqGADxrYqw33KoxWA0GOcrobdpDQq8U9Ni7slefMn7PB4lpHvOdu77 80oTXB6rH0HL1eRq09vgne9f5kouPqkfrz/xIbR13H7WreW+2XDQzBO4fgPiz3uKcPZJ 5RQw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=9E9FEd3Tu+4S+Gw8JExKzSs7Qwdz1/Mjy+Z3v6Jr7cU=; b=K0q7h/kwziHknKHADjbo/Vv0726+mo0lNuj8tD+AvjqAFVXEFs0VN1jU6ESCEdgUXS LUTFoC3mqJAxJulmlnP4u7cYsP572AOFyh6qtVHSAiWxZpvBrCADg92IhPAVGwrzkFJ6 VR86oLyHOTYs+lMYxWXVJTIf1L+j+PusYe0sO/pYBXLpKJ3XQbRHRGLcfnRXOKJBv0PL O6LyuV3AjaO3K/X5BoNriuUQzb1Qn0UqccReXtRj4FxDpI26NmwJ+S3to66dsDG5cr/n 1+wqEE+SfnJN7buY+3edoTeLDyrXp/iQpUuKGSSTjigsHWMLGvpWeY2r+UvfOeABRb2L cmRA== X-Gm-Message-State: AO0yUKU4OhgFsKZ+TvXkhozKJP7QMyRab01E3ASEkbOUjkz0uLOmutPx xGhQf+dgU2D1emB2Jpc02VmoXrGhRSPGOLK1 X-Google-Smtp-Source: AK7set8LsN/GlSuklRNK8Dg03ytBz6fsZrOhAIYUhjaVKtizbGoZXOwsijKSFuR7+ALOeAZwkR1+fQ== X-Received: by 2002:a05:600c:3c8a:b0:3df:efdc:6505 with SMTP id bg10-20020a05600c3c8a00b003dfefdc6505mr4712038wmb.0.1676271906790; Sun, 12 Feb 2023 23:05:06 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org, Eduardo Habkost Cc: Gonglei Arei , Li Qiang , Cao jin , Hu Tao , qemu-block@nongnu.org, qemu-ppc@nongnu.org, xiaoqiang zhao , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Paolo Bonzini , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PATCH v2 8/9] hw: Use qdev_get_parent_bus() in qdev_get_own_fw_dev_path_from_handler() Date: Mon, 13 Feb 2023 08:04:22 +0100 Message-Id: <20230213070423.76428-9-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230213070423.76428-1-philmd@linaro.org> References: <20230213070423.76428-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::32a; envelope-from=philmd@linaro.org; helo=mail-wm1-x32a.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1676272041513100004 No need to pass 'dev' and 'dev->parent_bus' when we can retrieve 'parent_bus' with qdev_get_parent_bus(). Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Michael S. Tsirkin --- hw/core/qdev-fw.c | 9 +++++---- include/hw/qdev-core.h | 2 +- softmmu/bootdevice.c | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/hw/core/qdev-fw.c b/hw/core/qdev-fw.c index a31958355f..c2df1f4796 100644 --- a/hw/core/qdev-fw.c +++ b/hw/core/qdev-fw.c @@ -41,9 +41,10 @@ static char *bus_get_fw_dev_path(BusState *bus, DeviceSt= ate *dev) return NULL; } =20 -static char *qdev_get_fw_dev_path_from_handler(BusState *bus, DeviceState = *dev) +static char *qdev_get_fw_dev_path_from_handler(DeviceState *dev) { Object *obj =3D OBJECT(dev); + BusState *bus =3D qdev_get_parent_bus(dev); char *d =3D NULL; =20 while (!d && obj->parent) { @@ -53,11 +54,11 @@ static char *qdev_get_fw_dev_path_from_handler(BusState= *bus, DeviceState *dev) return d; } =20 -char *qdev_get_own_fw_dev_path_from_handler(BusState *bus, DeviceState *de= v) +char *qdev_get_own_fw_dev_path_from_handler(DeviceState *dev) { Object *obj =3D OBJECT(dev); =20 - return fw_path_provider_try_get_dev_path(obj, bus, dev); + return fw_path_provider_try_get_dev_path(obj, qdev_get_parent_bus(dev)= , dev); } =20 static int qdev_get_fw_dev_path_helper(DeviceState *dev, char *p, int size) @@ -67,7 +68,7 @@ static int qdev_get_fw_dev_path_helper(DeviceState *dev, = char *p, int size) if (dev && dev->parent_bus) { char *d; l =3D qdev_get_fw_dev_path_helper(dev->parent_bus->parent, p, size= ); - d =3D qdev_get_fw_dev_path_from_handler(dev->parent_bus, dev); + d =3D qdev_get_fw_dev_path_from_handler(dev); if (!d) { d =3D bus_get_fw_dev_path(dev->parent_bus, dev); } diff --git a/include/hw/qdev-core.h b/include/hw/qdev-core.h index f5b3b2f89a..93718be156 100644 --- a/include/hw/qdev-core.h +++ b/include/hw/qdev-core.h @@ -774,7 +774,7 @@ bool bus_is_in_reset(BusState *bus); BusState *sysbus_get_default(void); =20 char *qdev_get_fw_dev_path(DeviceState *dev); -char *qdev_get_own_fw_dev_path_from_handler(BusState *bus, DeviceState *de= v); +char *qdev_get_own_fw_dev_path_from_handler(DeviceState *dev); =20 void device_class_set_props(DeviceClass *dc, Property *props); =20 diff --git a/softmmu/bootdevice.c b/softmmu/bootdevice.c index 2106f1026f..7834bf3333 100644 --- a/softmmu/bootdevice.c +++ b/softmmu/bootdevice.c @@ -214,7 +214,7 @@ static char *get_boot_device_path(DeviceState *dev, boo= l ignore_suffixes, =20 if (!ignore_suffixes) { if (dev) { - d =3D qdev_get_own_fw_dev_path_from_handler(dev->parent_bus, d= ev); + d =3D qdev_get_own_fw_dev_path_from_handler(dev); if (d) { assert(!suffix); s =3D d; --=20 2.38.1 From nobody Fri May 17 07:56:17 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1676272020; cv=none; d=zohomail.com; s=zohoarc; b=DI+bBRTcy1Zn55I0swC+Sa3wGLbqvtrg6Vu7qpAlaa4pz2Ke8xD6HkOFUm7V8ySPs0dIlS3VV7l0dJpZoqOw1Q0c+aw6MffngjpQcQ4guG/Ywd3q2m82hDbYMNLL3EmQHd22ZRAFNv/R900IACghYMMe5qBNWZrQK3THeD92E/I= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1676272020; 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=md/V7qS9+MXg+4Y+2ycjl2bad9V4Bp92Z+1RWOwRBno=; b=crcZ2gsiP7/bM0fmqO18CQM2K3IjNxCYX8pAyBCi1OBRV28qhPVagV0YvK2I+y2+kqCJGDU8y5f6Tz6cgStqsjK5tw2W+w80K4tOLtMcASC7lMrupyhmherfISVFqcSONua2VTPc/XG3zmNtdjrk9HjUSa8b+80LEsbSgvbJL3Y= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1676272020453561.0597651900355; Sun, 12 Feb 2023 23:07:00 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pRStp-0001B9-VT; Mon, 13 Feb 2023 02:05:17 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pRSto-00019Q-FM for qemu-devel@nongnu.org; Mon, 13 Feb 2023 02:05:16 -0500 Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pRStm-0000t0-2e for qemu-devel@nongnu.org; Mon, 13 Feb 2023 02:05:16 -0500 Received: by mail-wr1-x42f.google.com with SMTP id o18so11066882wrj.3 for ; Sun, 12 Feb 2023 23:05:13 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id t15-20020a5d534f000000b002c55306f6edsm3759375wrv.54.2023.02.12.23.05.11 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 12 Feb 2023 23:05:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=md/V7qS9+MXg+4Y+2ycjl2bad9V4Bp92Z+1RWOwRBno=; b=PxDf/SH2ShPie6GsyT7i2RpbRLYGrgkKYImchGuWskFRsYoqJSH7lQbPOm3eAFYU79 18r/Xy+f0XqBBjDGMNFAs/UBJtaYfvoms7YLgjf27v01gjU2XvlHoNZHPJ42XG169Og4 21H7iUdXWn/A0d4kkP+jsfrYRMeIBBjgFQi74Xw9HwBetHgUdtovTeuTxWJGFmCq6Z0B 2uBXbxFZrzQ+RFF1QB8P7qCywR9B3eb9zRcX7MxZYhVDYNUrW0JRY+R0nNdbEJLEDxmA Rq7Ue09fW/DH6THeCIo72737OK0+Y3jtGp5pFj6PqMy2DvO3i8iS4bkR6uLKo9VlqNjB CIiw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=md/V7qS9+MXg+4Y+2ycjl2bad9V4Bp92Z+1RWOwRBno=; b=M+8tYf9do1rKyNeTcWadLNq20C7yygnsAvVmngbdHFRIBeZU9k1CJ75ibGXmYoE2Jm 0Aa/JDbeUHnOACau4CUm7km/eccI+vBABV8iZIA/dERH7waBKqjCPiNsLtkXvqDogfP0 pWfec2khvkJTxw/CGiEbE5jL0e0d1dFs+iCNONXhYVFiV4wmc7pg6I90gPLmv/SaKwb1 r5oTXA9MnGebd2niTSYE4h8ogmZRHR9whONoxzXB/L38BaAv7c3QE2E046sUxOyoTK75 Tebt78OZkhp9VcOhReDWJ+Ux3tfYBMt/aC6Vsh7EFeSQZDWiR2cT1lXdFyQMyxy1vRlL 27Wg== X-Gm-Message-State: AO0yUKVpYn4xE0WE0cFBc7JfyJP5Zb976VvlfedKGVzPMpGuGy+LFLp9 eCqeBLEI2VKkH6Zq63aSKHgFM43vyeACMKSR X-Google-Smtp-Source: AK7set+tW1x2hijghuCuuG1y5DKtns9TyCUs9YzcCzQtSrD4XYy9g2AYNQpwm7udj7HOkmdBc8fhlA== X-Received: by 2002:a05:6000:c8:b0:2c3:db98:3e87 with SMTP id q8-20020a05600000c800b002c3db983e87mr18419813wrx.20.1676271912399; Sun, 12 Feb 2023 23:05:12 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org, Eduardo Habkost Cc: Gonglei Arei , Li Qiang , Cao jin , Hu Tao , qemu-block@nongnu.org, qemu-ppc@nongnu.org, xiaoqiang zhao , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Paolo Bonzini , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PATCH v2 9/9] qdev-monitor: Use qdev_get_parent_bus() in bus_print_dev() Date: Mon, 13 Feb 2023 08:04:23 +0100 Message-Id: <20230213070423.76428-10-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230213070423.76428-1-philmd@linaro.org> References: <20230213070423.76428-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::42f; envelope-from=philmd@linaro.org; helo=mail-wr1-x42f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1676272021339100001 No need to pass 'dev' and 'dev->parent_bus' when we can retrieve 'parent_bus' with qdev_get_parent_bus(). Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Markus Armbruster Reviewed-by: Michael S. Tsirkin --- softmmu/qdev-monitor.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/softmmu/qdev-monitor.c b/softmmu/qdev-monitor.c index 820e7f52ad..12e4899f0d 100644 --- a/softmmu/qdev-monitor.c +++ b/softmmu/qdev-monitor.c @@ -770,9 +770,9 @@ static void qdev_print_props(Monitor *mon, DeviceState = *dev, Property *props, } } =20 -static void bus_print_dev(BusState *bus, Monitor *mon, DeviceState *dev, i= nt indent) +static void bus_print_dev(Monitor *mon, DeviceState *dev, int indent) { - BusClass *bc =3D BUS_GET_CLASS(bus); + BusClass *bc =3D BUS_GET_CLASS(qdev_get_parent_bus(dev)); =20 if (bc->print_dev) { bc->print_dev(mon, dev, indent); @@ -811,7 +811,7 @@ static void qdev_print(Monitor *mon, DeviceState *dev, = int indent) qdev_print_props(mon, dev, DEVICE_CLASS(class)->props_, indent); class =3D object_class_get_parent(class); } while (class !=3D object_class_by_name(TYPE_DEVICE)); - bus_print_dev(dev->parent_bus, mon, dev, indent); + bus_print_dev(mon, dev, indent); QLIST_FOREACH(child, &dev->child_bus, sibling) { qbus_print(mon, child, indent); } --=20 2.38.1