From nobody Sat May 18 15:38: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=1676242152; cv=none; d=zohomail.com; s=zohoarc; b=BcDwmARm8gXMWPsfXvhjiL6IIxfHpIDC07wa6aXCMSYFyfyMjRB33yB6sVcO4Fu4fDK1fBsi6j3Fri0wW2FG6PrbObg+LteUEnDkzYD7FArDhJnwiu2MG51GGzfWkUJW6eDPtCPmBDYbNE1NVdST3MHf3LYe1Po8X52YiUSlWDk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1676242152; 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=mKWXX396yliWQYbK+IUuNeQNwqinPkhgmkbP3m+k8lYx/IKXKH1pY7wQnUREJan4CAMN6heOaZlIDgzZGTxQC4kWazY7gYtB2EoOttDly/K+wKJfpw7V6F/OjIrgWDG4d3iNBjrDl80TLMEe1c97PujBrYzLdtHXL9yTz+CQzJY= 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 1676242152042111.40527868665879; Sun, 12 Feb 2023 14:49:12 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pRL8I-0001Lx-5f; Sun, 12 Feb 2023 17:47: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 1pRL8G-0001Lh-SI for qemu-devel@nongnu.org; Sun, 12 Feb 2023 17:47:40 -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 1pRL8F-0003Hw-CX for qemu-devel@nongnu.org; Sun, 12 Feb 2023 17:47:40 -0500 Received: by mail-wm1-x32a.google.com with SMTP id n33so1528880wms.0 for ; Sun, 12 Feb 2023 14:47:39 -0800 (PST) Received: from localhost.localdomain ([185.126.107.38]) by smtp.gmail.com with ESMTPSA id w23-20020a1cf617000000b003db1d9553e7sm15139526wmc.32.2023.02.12.14.47.36 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 12 Feb 2023 14:47:37 -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=QJQhtvzxYRjF2+O2PHDmhkguSW4JY1s5NkcHw4pZ4WzebGxrwpRpgO/zqF0VGJztf3 uAeR1K9byj1Qng1ApxmHVgCPpWJ4kgwMAKBRGqA/Bx4JGet8T4PLeyxoWGyxswXLk7xK /L5F5HyuLgYpZtmY7r62mY7gMdbsknbBdRuI0Z3id7ZxI2wqoiFGpRob6kj8Rl2f5MP2 PjFzzEQA1VB1wHczXfzYrKq0CfV1J/8cayZMbkj1ajrf8f+UGCRjTEzj7XUkMdU+fYo/ H73u3p2u6jDO8txR5l8b/qWk/vajLlEFzrZNzTFQUWf82qgpe28Zj8I0JErlYMlg7ZhY 9lQA== 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=DBb01OQKIunQOE7q+PeZOdLRQBE8cIpxGp6OS4DRLpINdEyDP+GNiYKGWzoKW+8RnM VFEhvYsTvFFevLBD12sJdBxFeo4mnAI9dcdw/u9WG/cgRC+EdpSm1Wz4ZTG2V0w2klSd nVCNCoPMeZ5TNXdyaY0z+4qSkiv2Excx14tguSV6o5oL2oQBpW66k6tDzszKeTL1ebd1 ez78U+iHZNyUq0JeACNs74Fso82Ar6QesjkHjbLyGz2Tbw0UuRHH+wa+J0YW7r45Fmm7 bkwPX5ytlrkQShdVaABi+LDkLLFTGpB1rzPoUXdNHUEv5W+bpf6JEY8coMUF3ywA5oUf 0LUA== X-Gm-Message-State: AO0yUKVqJZD52g/E5Khil9PptAAUri6UZExz0c62/5FchuzGWb1rGvDT lMI3sexWF/fmE56fE3L14pZLOcOL0DH+wCCw X-Google-Smtp-Source: AK7set/wlJIED7yItPydhY+PgHHa5yehGvcHNS/n6p7MHkSaTAAHusnlfmSYsdCdlfFnYyo0PYYQVA== X-Received: by 2002:a05:600c:4485:b0:3e0:185:e93a with SMTP id e5-20020a05600c448500b003e00185e93amr17964854wmo.25.1676242057974; Sun, 12 Feb 2023 14:47:37 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-block@nongnu.org, "Gonglei (Arei)" , Eduardo Habkost , Laurent Vivier , Paolo Bonzini , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PATCH 1/4] hw/qdev: Constify DeviceState* argument of qdev_get_parent_bus() Date: Sun, 12 Feb 2023 23:47:27 +0100 Message-Id: <20230212224730.51438-2-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230212224730.51438-1-philmd@linaro.org> References: <20230212224730.51438-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: 1676242152854100003 The structure is accessed read-only by qdev_get_parent_bus(). Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson --- 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 Sat May 18 15:38: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=1676242131; cv=none; d=zohomail.com; s=zohoarc; b=lbziPVQ4Uf5fb4VTZhoL3Qhko/iY8dWQtUCbFv3SRx1MJsNzXqkAF9ZJArpdvqE1Ah7TM9KTlzn/lfXS6v1g5/nLuPo5ZeeNpny8bdSm7lir52TofSHuBSlZdWbZ3PBMEePUXiaQfH5nVqlay4NAXobw7LVxiQWZ1XElYNuC98o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1676242131; 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=0g+OKIY42HUqYw3UQ9cJG+AfIPwvafK4fS3QuXAucdQ=; b=haGsogJ5fCtG3GdETYYmlb5fXtQsdbMNMlPs+NlgPZ4A/TEzl2IcpkwGRsUaSKKPWK0p4pBcRG4jsncGlqfUlyhnNborvH7hHk/e5Aww7fiEu592TBWfyGmOfc3RrkYpxy8Hb4lI2PoTZPMRaXgveAglj+7NtyGkX4+VgFYNmt4= 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 1676242131297144.85423546994537; Sun, 12 Feb 2023 14:48:51 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pRL8O-0001OL-Ui; Sun, 12 Feb 2023 17:47:48 -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 1pRL8N-0001Mb-BY for qemu-devel@nongnu.org; Sun, 12 Feb 2023 17:47:47 -0500 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pRL8L-0003IM-Bp for qemu-devel@nongnu.org; Sun, 12 Feb 2023 17:47:47 -0500 Received: by mail-wm1-x333.google.com with SMTP id az4-20020a05600c600400b003dff767a1f1so7760702wmb.2 for ; Sun, 12 Feb 2023 14:47:45 -0800 (PST) Received: from localhost.localdomain ([185.126.107.38]) by smtp.gmail.com with ESMTPSA id f24-20020a05600c491800b003dc0cb5e3f1sm11393219wmp.46.2023.02.12.14.47.42 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 12 Feb 2023 14:47:43 -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=0g+OKIY42HUqYw3UQ9cJG+AfIPwvafK4fS3QuXAucdQ=; b=shXjCloISjiE+oHmYwgCh6KfYZbPp1ZyN2WMU3N56mqsYk5BwJN3uaci33/kWXNezY j8bwa4s7TH/62YFlnuhAMWcQu35MCI3iPyEUkBYDeZfjUC1aKtPJqeIIf0FKqlFR8FWN WpMpAJzyvoizWvIvcx2UgmvVpe5LIualcqNN4Tbat5P1xwZXJNVaoEXPuOpq/Getkssf +La+SHF1J22nVq526ontxrUgsX4ISKqCLpsFpla6xBsZMZPBWArPn+mfT2xjRtD+srrl PmY01Tg/+qN5WIenzX6uGBV520CNrYAL+gbCd/GOFnTZMZx6I7jTSpSLk/uf5/Vdftf4 j+qw== 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=0g+OKIY42HUqYw3UQ9cJG+AfIPwvafK4fS3QuXAucdQ=; b=RZsbqvFWftXvK+85OZ3f1Sb8NVXFDj0KGg35JtH47xTqfc3wej/ajLiWRmq5Ku9IuL mVTHOqjxRi5Wjrw8U7ujcAFpDj7mxwM8LpEPQBwgk/GdbRppg3773935FkSq1A+jLvo3 c5TD0GnVPCcoBuhof1BCFy92K4r1LFcpeFXlEQ4WHYfkf1yJWef1FH7BSeFZ6/LWOY9h VTqeHjZu/QShlU2CrSL8tzxSo7TleK8UgeHxcA76xXycF5BE95tRWpsvSi0t57Uwbd0u G9FZyvt0hw4QIgUdE9WX6qSlj/wH4druk2tfRrElFE3asr46uORvTFcMGFr7MxAsfrt/ zBBg== X-Gm-Message-State: AO0yUKUOWKqbb8oZaZQxzLFf4myQodtEQRwKRBFQLZ2/+xlOU0XxSfGV xTBDc3quZExz2vsi+dfjkKOvDMVaxIn/PpSQ X-Google-Smtp-Source: AK7set8RTMBAt6p0nKHz5kcfR1Yc8ag3TbHKJ+Q6sGJ+rviJTz+ruB2dXi9D1H7CSCiQPDuxS1Oy7g== X-Received: by 2002:a05:600c:490a:b0:3dc:433a:e952 with SMTP id f10-20020a05600c490a00b003dc433ae952mr17301775wmp.33.1676242063879; Sun, 12 Feb 2023 14:47:43 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-block@nongnu.org, "Gonglei (Arei)" , Eduardo Habkost , Laurent Vivier , Paolo Bonzini , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Gerd Hoffmann , John Snow , Kevin Wolf , Hanna Reitz , "Michael S. Tsirkin" , Jason Wang , Marcel Apfelbaum , Fam Zheng Subject: [PATCH 2/4] hw: Replace dev->parent_bus by qdev_get_parent_bus(dev) Date: Sun, 12 Feb 2023 23:47:28 +0100 Message-Id: <20230212224730.51438-3-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230212224730.51438-1-philmd@linaro.org> References: <20230212224730.51438-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::333; envelope-from=philmd@linaro.org; helo=mail-wm1-x333.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: 1676242133009100003 DeviceState::parent_bus is an internal field and should be accessed by the qdev_get_parent_bus() helper. Replace all uses in hw/ except the QDev uses in hw/core/. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Acked-by: Richard Henderson --- hw/audio/intel-hda.c | 2 +- hw/block/fdc.c | 2 +- hw/block/swim.c | 2 +- hw/ide/qdev.c | 4 ++-- hw/net/virtio-net.c | 2 +- hw/pci-bridge/pci_expander_bridge.c | 2 +- hw/scsi/scsi-bus.c | 2 +- hw/usb/bus.c | 2 +- hw/usb/desc.c | 2 +- hw/usb/dev-smartcard-reader.c | 16 ++++++++-------- 10 files changed, 18 insertions(+), 18 deletions(-) diff --git a/hw/audio/intel-hda.c b/hw/audio/intel-hda.c index b9ed231fe8..6bc239a981 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 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..96582ce49b 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; 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; 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) { diff --git a/hw/scsi/scsi-bus.c b/hw/scsi/scsi-bus.c index ceceafb2cd..3127cd7273 100644 --- a/hw/scsi/scsi-bus.c +++ b/hw/scsi/scsi-bus.c @@ -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 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 --=20 2.38.1 From nobody Sat May 18 15:38: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=1676242119; cv=none; d=zohomail.com; s=zohoarc; b=ewW7v+Y8BYfDkWwHjSDRIKquFNBXyZysWe/SnVokRjC6jZwBZC87Bpp/TBKuc509v1CwtktrnJBMS4sLfZ/TUp8wWBXyM7J8rzKTWVVR1bIEUvcZhPTN2rgytnsmhiaAimK8qguesOqf/v1qbH0ycHkJ+21E0BEobee5ENmS/SU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1676242119; 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=iynDL1WJbbBYdsCotUDK6RhPJZMmHydc4kZHYuNj9cQpV3wkitApUxn175tNXlb/smI7Wnqf0jN2O1CbNdCW+bGXPDDapYBFbgpNqr7FnLE5qknue2lSXSZZbusyT0J6d/PnC9xk+wNqUCQoBny0MkTGGMMmEvaeshJFZ6T4n2o= 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 1676242119633862.9047322259255; Sun, 12 Feb 2023 14:48:39 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pRL8U-0001PR-Ow; Sun, 12 Feb 2023 17:47:54 -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 1pRL8T-0001P6-8U for qemu-devel@nongnu.org; Sun, 12 Feb 2023 17:47:53 -0500 Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pRL8R-0003K1-Hu for qemu-devel@nongnu.org; Sun, 12 Feb 2023 17:47:52 -0500 Received: by mail-wr1-x436.google.com with SMTP id h16so10411916wrz.12 for ; Sun, 12 Feb 2023 14:47:51 -0800 (PST) Received: from localhost.localdomain ([185.126.107.38]) by smtp.gmail.com with ESMTPSA id v18-20020a05600c445200b003de77597f16sm13141561wmn.21.2023.02.12.14.47.48 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 12 Feb 2023 14:47:48 -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=CT0ICUD7yUsLLt1k58jhfr/5JwMrCOVnKcoEVcIU9XhTJtp65CZlwuHTLui1EDRE7D kSmHJS8D79SGfKEm8EiDJusd1m4+yNsx5RUX7wpi6PLtK0GtMfbquYcykeVBDO7K3qaZ JUZ8yVlrqMunBNNFYwEkr8vli8R4r3WB6GsrRiVa8d82nXuRj0cBLI4XqEboNno5B/f/ ivcUtcZ6IHvGDuKXTILhCxfhu1cnPRoFoFY0vnxbf/3SLekyCWX+hbi4MqjoEUrwht9f CQE7+VQ8/7ndhxCgGGo9ulK1AHG5BSvbpw1m8Z1N4XhhyOv4OZXoRynP7hdbX51WxL/8 Q0HQ== 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=EWs21O8nEuOf+0D+4TOJkJitDD3m4QbRvGaTkYzb2d5PRGItabMbwpXD67x7jGsTuu Tnok15T7fAR8Sj91LOWTR0XWwMoXu+NFzlhguo/RufWxk5yUDOUp1m7Sr32dTxQaL4SB 6zj1hQm5Giitcm8RVD+N2uCTh758fcBML0X2CBk2PImPtX09kl2yjXcv83rY3RON04H9 /pmIHVHibymHTEsdyOm7ZEFtX2yx+eCJHvo/ql5q+Fafagf8q//Ed/GCaeTjjzT8gAWX TG6YzE5FJtl94Gw+QpkU8G6CTUaZZim/ElAr1voBCmcr5WC7lM88Wbu7ANwOkiIGsFmv bYwQ== X-Gm-Message-State: AO0yUKVuLvuqUYffcBxIDrqRazrz6XZpP8nhHMwTUSQR+cJ9Ag2zQIM/ RhGz6eXgRQPgml0vjPjRy+lO9CH29+UupUQA X-Google-Smtp-Source: AK7set+W43yobp3iVhR993oFloJE37NOIfaaO/6zaackYFj5ok9z28q8MGYHNWF4iT5mCR1sgXAR3A== X-Received: by 2002:adf:de8d:0:b0:2c5:4c64:d35b with SMTP id w13-20020adfde8d000000b002c54c64d35bmr5781611wrl.15.1676242069025; Sun, 12 Feb 2023 14:47:49 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-block@nongnu.org, "Gonglei (Arei)" , Eduardo Habkost , Laurent Vivier , Paolo Bonzini , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PATCH 3/4] hw: Use qdev_get_parent_bus() in qdev_get_own_fw_dev_path_from_handler() Date: Sun, 12 Feb 2023 23:47:29 +0100 Message-Id: <20230212224730.51438-4-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230212224730.51438-1-philmd@linaro.org> References: <20230212224730.51438-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::436; envelope-from=philmd@linaro.org; helo=mail-wr1-x436.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: 1676242121073100005 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 --- 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 Sat May 18 15:38: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=1676242145; cv=none; d=zohomail.com; s=zohoarc; b=hpp+lXxPwywMJ8fwXqQTxNfNpzB07TYgd+IBNOYJ20nyinjtpfWc0f/WkwzcsgZeZ0Hn9/DI8cOo2KmwvTTVKkQz+LCPejetNGeYuRsYuj54mTVMfZPFr7KuVHqI5POB11GETgkB7cwi9T/4o8jquDZOk8yKMlb6CaU+CTkUE+g= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1676242145; 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=e839mC1OgYofk6Ezm2lByk/AUFAeqlE9+lhzAZeWyWLPeHFQkuP4tlwK8kKeghX9FGKzWcjMql/1lZ+U2Um/5h3rfUwnXWE8T+pyKFevwXe+0G6fh5LC3i/u6oFRUtZNqqlVb05PiMOODgsz2B+61AmsV0QiBeNp+5EaLytydc8= 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 1676242145196873.5729140293232; Sun, 12 Feb 2023 14:49:05 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pRL8Y-0001QG-E8; Sun, 12 Feb 2023 17:47:58 -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 1pRL8X-0001Q0-9u for qemu-devel@nongnu.org; Sun, 12 Feb 2023 17:47:57 -0500 Received: from mail-wr1-x430.google.com ([2a00:1450:4864:20::430]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pRL8V-0003KT-Pl for qemu-devel@nongnu.org; Sun, 12 Feb 2023 17:47:57 -0500 Received: by mail-wr1-x430.google.com with SMTP id by3so9129073wrb.10 for ; Sun, 12 Feb 2023 14:47:55 -0800 (PST) Received: from localhost.localdomain ([185.126.107.38]) by smtp.gmail.com with ESMTPSA id b5-20020a5d4d85000000b002c54b0e1405sm6624600wru.88.2023.02.12.14.47.53 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 12 Feb 2023 14:47:53 -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=OmzXMfDgenPT28XW7WDtCqaEJT9TIi+Yf3WHmkumz2tKR51kiVSQJwICEJK9FTEI+J wOu2GaoZjIu6LXvRWAckPelm4z6jGGTDcNzYpVVEfrUJfiDLT3JhBsBhcvuidoqzv0vN 25P9jsAudYtqqGlgn/bBNj86Hlm9FcKvXPpNnWG13aW1W8ytgOyEkmU84tzesRvYHonn 3WVzOE/tTmg9yAwEMjeqSFInNh81twqd7qP8rLFugpRSpyflb5GqY8xLs8+qxq55XYz7 f/42x7sWFUSrcTBk+DUvn3q15wM1tN8YAJRO0wVz01XU6Y4iukyez39BcSgd9LRcyFP7 g3tQ== 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=7VbtpfzXEFRxabOiDu7rmiBtKaq2LyG7W70zhz0P9UcneeqC9cAxtXhU38LCdq+08g Y5SWIj6fS3qwmGQSWUseMMWJFAIiuljIlSdh0eoUTpkBN7Y5M7KFbVVap6SXVMHxhklH okJZy0nfH/7pmO2ejAgyZhOaR0T/dW49DVlQ+cNOP13QHveY7G+CO10jyBu/FGHOxcbr E2sn11oz1Cn6IFUiRgdWzEWh7GucKbP9fRftfWMbKLrUnKuf7qWXfow4L7cX8SaRe105 hBLHDnB6Mn18dlYtisynkrIUfbdAfe2Mhl+7/dMw1VOtHVHm9D2wptkLlMIn3exbdKPL Ujlg== X-Gm-Message-State: AO0yUKXiGPth9TIJwnoRgdjC3jEHNqVmijoKRr3x+3MMnKkc+l3Jw7ds 8t6XLpC6zfZEyFnnSM43tgI7nL+KXpffjMVX X-Google-Smtp-Source: AK7set//ZNA0TxtkLxn0IHD8mNGt/VNW4eJrjqM+1zUqqia65OSCN0HhqQLAYGEWRUrwCGiwaXCPDw== X-Received: by 2002:a5d:4090:0:b0:2c5:5933:1752 with SMTP id o16-20020a5d4090000000b002c559331752mr897799wrp.52.1676242074157; Sun, 12 Feb 2023 14:47:54 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-block@nongnu.org, "Gonglei (Arei)" , Eduardo Habkost , Laurent Vivier , Paolo Bonzini , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PATCH 4/4] qdev-monitor: Use qdev_get_parent_bus() in bus_print_dev() Date: Sun, 12 Feb 2023 23:47:30 +0100 Message-Id: <20230212224730.51438-5-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230212224730.51438-1-philmd@linaro.org> References: <20230212224730.51438-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::430; envelope-from=philmd@linaro.org; helo=mail-wr1-x430.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: 1676242146728100003 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: Richard Henderson --- 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