From patchwork Mon Feb 13 07:04:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 653159 Delivered-To: patch@linaro.org Received: by 2002:adf:f90f:0:0:0:0:0 with SMTP id b15csp2265215wrr; Sun, 12 Feb 2023 23:06:00 -0800 (PST) X-Google-Smtp-Source: AK7set9mDOxOrbv7egnHvafSZ5mZbdz2iZgXTRnKRGtxc76m+NOsqmYYpQz6VGc35RLEJdhf0+kl X-Received: by 2002:a05:6214:2a83:b0:56c:2158:9e3b with SMTP id jr3-20020a0562142a8300b0056c21589e3bmr28851458qvb.25.1676271959943; Sun, 12 Feb 2023 23:05:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676271959; cv=none; d=google.com; s=arc-20160816; b=mEvC4qaquuV1JG/7vqwwRugw2wcxFnM6+Kd9kEkrLqU9D+jfkGDD1aX9eirRyaARoH Vr3Knyg9HYATkelnd36uMQntrsTGNs6J++/CZncClq9qVSpAn3aJ4ax8SkfzbogZZEKw CQDBp4tEvmpd4EwyIR9pFfdqY0D13v1i4UN2PXES+A8bLDhpjEwAqFITTaWrq9TNl1cc U0wsEsAVLHRMDUfjnDt/eoCqHMQCvw/9/V7fASGOT93Q9Vmkv5dZ/FKqdlhl8BTuQOh4 Ncez38dgB5mQR6BpfrfO2+095MpciG5aorXQZRFlBJEk7xCQKjM8Z46yyA+f73JC4sYs 9/Vw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=XKF2b7pEm6HyiNp404lQ+Vuu44DHRtt9tfJtec4bL+4=; b=upOq2xzpoQK5dGTDKaF6iOOaV3w+H3aOAJci58OIkPo/aFiAaUT76TIsVfW8EgwjIr tnGxUwBBE8wmSnj5UFTm4if4L5q2s4tS6+/F6hSwSbrkAXO730KxM2tXlbrgMXWWWif0 eMSIewy8PAkRkHOLzFasYzuWAqmkRcdWPqX8fuenSEhcGL5PJRElX0SSCJgI2f3uK81E 725yU9XfOc24pH3SxJzp5jTQblg53xsFYDOvdcEWg3OkKh5lra0AnWoVbEhl6MJcvZMF Dpsd3Ami+Ue3oeWvX7/Mr75FOVMz8YuTMEB+YH18SjUlg5YMXH4NUKQhQrVYqY+FC49q CnQA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=QtIn3LAs; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id c14-20020a0cf2ce000000b0056c242d9f79si1512108qvm.554.2023.02.12.23.05.59 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 12 Feb 2023 23:05:59 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=QtIn3LAs; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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) 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-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) 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) From: =?utf-8?q?Philippe_Mathieu-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_Mathieu-Daud=C3=A9?= , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=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 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org The structure is accessed read-only by qdev_get_parent_bus(). Signed-off-by: Philippe Mathieu-Daudé --- 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; } -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); -BusState *qdev_get_parent_bus(DeviceState *dev); +BusState *qdev_get_parent_bus(const DeviceState *dev); /*** BUS API. ***/ From patchwork Mon Feb 13 07:04:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 653161 Delivered-To: patch@linaro.org Received: by 2002:adf:f90f:0:0:0:0:0 with SMTP id b15csp2265393wrr; Sun, 12 Feb 2023 23:06:30 -0800 (PST) X-Google-Smtp-Source: AK7set+6TMVesmrT8YOza2Q8OoTY78gK67Ude3GO1GH5Hhx4CelCeBGuEFKDFtSZFoJebjOhmu6L X-Received: by 2002:a05:622a:40e:b0:3ba:1a25:f66 with SMTP id n14-20020a05622a040e00b003ba1a250f66mr39803461qtx.53.1676271990517; Sun, 12 Feb 2023 23:06:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676271990; cv=none; d=google.com; s=arc-20160816; b=JP8kSlaYTOSKHQUrAvOoWqQSRD2yGw78FqPY1y8lmOay5pUFL9JIW7us/3NzMbvd4J hhMw9nLKpUJQz0Eusv4NZFbAaH10bpS5kIFtHXrjqYQie3cIlgpe6EofkffeSg9Vi+nT 8TPHcvBLktA+Rk9Ay7DBc0zXRZSwdpu1+7gdfy3zta8Oz8jAwOmtFWBGRNecZ7bm6J1u Yjkj2nFjK2HvrMM5yajdazH6/8J6ViEHVQXS+Rja8VBb2/hesgNvqEAd0IFbnckea9Dz rj1R/UtFNyX+ErCSsFQiHn5KzdRutGJZ1wefJ+unpt8H3OMmVE+cysPLpHFGlGBM+aPO 2r8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=5i16l2BnG5bR396mqVfBfc0/x+tQE8lt1qXCAB9bxlU=; b=DZ3L+ivH6807eg6iaSsSsBt00ygoUUxWciymuGStE5kG7jVSWP7kI4QW9iWZkK4fgl CPHME07mubt/9vNA+RCNQftIzmUU9FubSwL/uiDUUyyhF/kwAjiySttRkJbI+rJUYCta IUXuet7087UN3SXGKQ0jiyqPodWskXYqbot8FrwECxpb5LKdcNqYUjNFDMfefFH3qYF5 NSBTgIyrix5aXllf/7Ji/q/XWpf+vkQZuveUhTNG37b8I11iXPEBjE0rlrj9KWj3/C3T rZbBepvHdMEeS6gbHQy8V/L3f82KcXsDUNB9E5dqxPn3NJApBJD4bG647dh9a/su/dOO ki2Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=EhPR2h+m; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id v16-20020a05620a441000b0071e0747deb4si10274646qkp.416.2023.02.12.23.06.30 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 12 Feb 2023 23:06:30 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=EhPR2h+m; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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) 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-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) 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) From: =?utf-8?q?Philippe_Mathieu-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_Mathieu-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 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org DeviceState::parent_bus is an internal field and should be accessed by the qdev_get_parent_bus() helper. Signed-off-by: Philippe Mathieu-Daudé --- 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 *bus, size_t bus_size, static void hda_codec_dev_realize(DeviceState *qdev, Error **errp) { - HDACodecBus *bus = HDA_BUS(qdev->parent_bus); + HDACodecBus *bus = HDA_BUS(qdev_get_parent_bus(qdev)); HDACodecDevice *dev = HDA_CODEC_DEVICE(qdev); HDACodecDeviceClass *cdc = HDA_CODEC_DEVICE_GET_CLASS(dev); @@ -103,14 +103,14 @@ HDACodecDevice *hda_codec_find(HDACodecBus *bus, uint32_t cad) void hda_codec_response(HDACodecDevice *dev, bool solicited, uint32_t response) { - HDACodecBus *bus = HDA_BUS(dev->qdev.parent_bus); + HDACodecBus *bus = HDA_BUS(qdev_get_parent_bus(DEVICE(dev))); bus->response(dev, solicited, response); } bool hda_codec_xfer(HDACodecDevice *dev, uint32_t stnr, bool output, uint8_t *buf, uint32_t len) { - HDACodecBus *bus = HDA_BUS(dev->qdev.parent_bus); + HDACodecBus *bus = HDA_BUS(qdev_get_parent_bus(DEVICE(dev))); return bus->xfer(dev, stnr, output, buf, len); } @@ -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 = { .memory = true }; - HDACodecBus *bus = HDA_BUS(dev->qdev.parent_bus); + HDACodecBus *bus = HDA_BUS(qdev_get_parent_bus(DEVICE(dev))); IntelHDAState *d = 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 = MEMTXATTRS_UNSPECIFIED; - HDACodecBus *bus = HDA_BUS(dev->qdev.parent_bus); + HDACodecBus *bus = HDA_BUS(qdev_get_parent_bus(DEVICE(dev))); IntelHDAState *d = container_of(bus, IntelHDAState, codecs); hwaddr addr; uint32_t s, copy, left; From patchwork Mon Feb 13 07:04:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 653167 Delivered-To: patch@linaro.org Received: by 2002:adf:f90f:0:0:0:0:0 with SMTP id b15csp2265646wrr; Sun, 12 Feb 2023 23:07:21 -0800 (PST) X-Google-Smtp-Source: AK7set988CSstRNQef/dQLXe7nLRbO9U3Yu/3h6icJfuDUTCJPPzzbgW99pUl4H8/rfGwtR+6zBj X-Received: by 2002:ac8:5842:0:b0:3b6:3508:2a3e with SMTP id h2-20020ac85842000000b003b635082a3emr43395933qth.4.1676272041133; Sun, 12 Feb 2023 23:07:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676272041; cv=none; d=google.com; s=arc-20160816; b=oaNMJG8c2GbPwmx+K6v6fgzBpUHYjJa7n9httrunNXMfYcnWm1/4z4AXiaINEauLqO cK9xsM4/I4ST15xxfTc2167YAnUME7UHaatQOpLJf+H9JmSp4TKOs29Y2QP8oQYRPkFM PhEGyH5RAvkIgmd4eVhfn/63BzCeXqnPW1cJe8vdZiCnKslCaYUioGnc7ru+Xv53xFZv zat7lPA4WuSr/aknNUW/tCvBQUGBxxFPM6CTZlYiK0MxlPjJbKP/5PJ2LzmflfHsuJhB gxgtW0oTU8Yw6OE+fLXdTCLEC9C++QDIf8yuFvqOY/peFlxS7rtdaopClIKOLRipof36 wQaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=VqE2ZOIm5Au9FYKFTyho0X2pkszAMeA9vGFnw1NKAis=; b=ntn1ntKE4F2m8XrC25xtLlhHdp/BjC1CQCVPuRzTMfxgJz4RUtiZsw5KEmvI7UH4Em dRZcqSTPMn/UyFU8vHFDO5kgIMpGURRk/KOX3mLCpKO4fKAW2pF65vNcjrwB8EoePDsu 1K+Y478RVAvTTRhY5DJtNTu0u45KxWEU7Fxolhw577m49tEb8GB2HnfmLIKVCnaWCUQa P5mP+58NTGHZ0TIZu4EF9RQ3tYDom9N2dFvPNsqH5Jm2XD02AI62P61Ug3z33NdEH/m+ UjO09ZSbmi/OcN/VzL1EY0pE5V/eH+qtXFEiSY+RbpiwDehp1N0jy+Pqzgql5YW54/JP 8yeA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=XMU6meUA; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id m21-20020a05622a119500b003ba10333aa9si9434794qtk.522.2023.02.12.23.07.20 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 12 Feb 2023 23:07:21 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=XMU6meUA; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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) 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-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) 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) From: =?utf-8?q?Philippe_Mathieu-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_Mathieu-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 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org DeviceState::parent_bus is an internal field and should be accessed by the qdev_get_parent_bus() helper. Signed-off-by: Philippe Mathieu-Daudé --- 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[] = { static void floppy_drive_realize(DeviceState *qdev, Error **errp) { FloppyDrive *dev = FLOPPY_DRIVE(qdev); - FloppyBus *bus = FLOPPY_BUS(qdev->parent_bus); + FloppyBus *bus = 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[] = { static void swim_drive_realize(DeviceState *qdev, Error **errp) { SWIMDrive *dev = SWIM_DRIVE(qdev); - SWIMBus *bus = SWIM_BUS(qdev->parent_bus); + SWIMBus *bus = SWIM_BUS(qdev_get_parent_bus(qdev)); FDrive *drive; int ret; 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]; snprintf(path, sizeof(path), "%s@%x", qdev_fw_name(dev), - ((IDEBus*)dev->parent_bus)->bus_id); + ((IDEBus*)qdev_get_parent_bus(dev))->bus_id); return g_strdup(path); } @@ -90,7 +90,7 @@ static void ide_qdev_realize(DeviceState *qdev, Error **errp) { IDEDevice *dev = IDE_DEVICE(qdev); IDEDeviceClass *dc = IDE_DEVICE_GET_CLASS(dev); - IDEBus *bus = DO_UPCAST(IDEBus, qbus, qdev->parent_bus); + IDEBus *bus = DO_UPCAST(IDEBus, qbus, qdev_get_parent_bus(qdev)); if (dev->unit == -1) { dev->unit = bus->master ? 1 : 0; @@ -164,7 +164,7 @@ typedef struct IDEDrive { static void ide_dev_initfn(IDEDevice *dev, IDEDriveKind kind, Error **errp) { - IDEBus *bus = DO_UPCAST(IDEBus, qbus, dev->qdev.parent_bus); + IDEBus *bus = DO_UPCAST(IDEBus, qbus, qdev_get_parent_bus(DEVICE(dev))); IDEState *s = bus->ifs + dev->unit; int ret; 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 = DO_UPCAST(SCSIBus, qbus, dev->qdev.parent_bus); + SCSIBus *bus = DO_UPCAST(SCSIBus, qbus, qdev_get_parent_bus(DEVICE(dev))); int rc; assert(cmd->len == 0); @@ -250,7 +250,7 @@ static bool scsi_bus_check_address(BusState *qbus, DeviceState *qdev, Error **er static void scsi_qdev_realize(DeviceState *qdev, Error **errp) { SCSIDevice *dev = SCSI_DEVICE(qdev); - SCSIBus *bus = DO_UPCAST(SCSIBus, qbus, dev->qdev.parent_bus); + SCSIBus *bus = DO_UPCAST(SCSIBus, qbus, qdev_get_parent_bus(DEVICE(dev))); bool is_free; Error *local_err = NULL; @@ -705,7 +705,7 @@ SCSIRequest *scsi_req_alloc(const SCSIReqOps *reqops, SCSIDevice *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 = DO_UPCAST(SCSIBus, qbus, d->qdev.parent_bus); + SCSIBus *bus = DO_UPCAST(SCSIBus, qbus, qdev_get_parent_bus(DEVICE(d))); const SCSIReqOps *ops; SCSIDeviceClass *sc = SCSI_DEVICE_GET_CLASS(d); SCSIRequest *req; @@ -1353,7 +1353,7 @@ int scsi_req_parse_cdb(SCSIDevice *dev, SCSICommand *cmd, uint8_t *buf, void scsi_device_report_change(SCSIDevice *dev, SCSISense sense) { - SCSIBus *bus = DO_UPCAST(SCSIBus, qbus, dev->qdev.parent_bus); + SCSIBus *bus = DO_UPCAST(SCSIBus, qbus, qdev_get_parent_bus(DEVICE(dev))); 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 == 0) { - BusState *qbus = req->dev->qdev.parent_bus; + BusState *qbus = qdev_get_parent_bus(DEVICE(req->dev)); SCSIBus *bus = DO_UPCAST(SCSIBus, qbus, qbus); if (bus->info->free_request && req->hba_private) { @@ -1444,7 +1444,7 @@ void scsi_req_print(SCSIRequest *req) int i; fprintf(fp, "[%s id=%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 = 1; i < req->cmd.len; i++) { @@ -1671,7 +1671,7 @@ void scsi_device_purge_requests(SCSIDevice *sdev, SCSISense sense) static char *scsibus_get_dev_path(DeviceState *dev) { SCSIDevice *d = SCSI_DEVICE(dev); - DeviceState *hba = dev->parent_bus->parent; + DeviceState *hba = qdev_get_parent_bus(dev)->parent; char *id; char *path; @@ -1698,7 +1698,7 @@ static int put_scsi_requests(QEMUFile *f, void *pv, size_t size, const VMStateField *field, JSONWriter *vmdesc) { SCSIDevice *s = pv; - SCSIBus *bus = DO_UPCAST(SCSIBus, qbus, s->qdev.parent_bus); + SCSIBus *bus = DO_UPCAST(SCSIBus, qbus, qdev_get_parent_bus(DEVICE(s))); SCSIRequest *req; QTAILQ_FOREACH(req, &s->requests, next) { @@ -1726,7 +1726,7 @@ static int get_scsi_requests(QEMUFile *f, void *pv, size_t size, const VMStateField *field) { SCSIDevice *s = pv; - SCSIBus *bus = DO_UPCAST(SCSIBus, qbus, s->qdev.parent_bus); + SCSIBus *bus = DO_UPCAST(SCSIBus, qbus, qdev_get_parent_bus(DEVICE(s))); int8_t sbyte; while ((sbyte = 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 bus_size, 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))); } SCSIDevice *scsi_bus_legacy_add_drive(SCSIBus *bus, BlockBackend *blk, From patchwork Mon Feb 13 07:04:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 653164 Delivered-To: patch@linaro.org Received: by 2002:adf:f90f:0:0:0:0:0 with SMTP id b15csp2265624wrr; Sun, 12 Feb 2023 23:07:17 -0800 (PST) X-Google-Smtp-Source: AK7set/Ek0ZOxqRuuxe5Q1Cu4xPAzi6WvhhBCf1XDIr/KhgPLPg8bft2PofYYNSRWhCsu722tsCA X-Received: by 2002:a05:622a:18a:b0:3b6:45f1:4933 with SMTP id s10-20020a05622a018a00b003b645f14933mr41524667qtw.66.1676272037818; Sun, 12 Feb 2023 23:07:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676272037; cv=none; d=google.com; s=arc-20160816; b=xUNMk1ryP8hLYXU/a4R2A+LzrfpOGRa9dkxiJg6445UfeGxVOIeCQ7z5zCOJPKFsKF 4SZ2wg7952qdhte1fBZDrsYLjMDw3i9npY7/iJV274D7IM6+dlHg+W4N/j0psW0qmmBb pAnF1mvP3p4FZsp9bJ1HKC1XaEKvAL6qYNEP8rnR11WpUNTgdU61Dx/GPMkplAjmLBfn 8LuOcvVfUYQ6x7/eK7d3+C+uUXBcJQJ7w+dv1puhs2TtKe4dxBHR+koo1zyW+hMikto6 fsJ+Oq76RFPea2Z1TNm7wbnGG0AHx08uKL3vouf0XENFhob0hZOmnJgxDT/W6yJls1Jq lxXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Jz/OlZ7doHa0+NAa3PesX+R44gnSBsZj1QZteHGnoxI=; b=V3G0+L9kLR6LgDTWEMyv1ALerf8AF0/XTnnav/peodEnx1MmoFOfV84fA8dEiDzKBl cnI/98VidLB4IO9s0wkyrNmfd5zzTXFbho9bOz3Sl5ubGJ8StL33XG/obWOGOui+nm34 6wjMDDS/luqBxex8Gom7V5Qxn8NAGUjJgk/2aXy04R2zSy18D4pCDCFlUA8y/y1imlux OD058ejXKcKwK445Sfmj1ZYgJJmxi+1OtzT4r5soBEBO1s+tCjIMVGmplkr8WRllnoxq 3PLe7QJ/+m7LpN4HNl32aDYVLbTDGvDbSXoVm02UGGGzzl7+D/uEKSU3pSiHNgAcBHP3 8AtA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=PaneiVAg; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id n6-20020ac85a06000000b003b63338abc6si9037808qta.12.2023.02.12.23.07.17 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 12 Feb 2023 23:07:17 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=PaneiVAg; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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) 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-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) 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) From: =?utf-8?q?Philippe_Mathieu-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_Mathieu-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 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org DeviceState::parent_bus is an internal field and should be accessed by the qdev_get_parent_bus() helper. Signed-off-by: Philippe Mathieu-Daudé Acked-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, DeviceState *dev, if (!pdev->partially_hotplugged) { return true; } - primary_bus = dev->parent_bus; + primary_bus = qdev_get_parent_bus(dev); if (!primary_bus) { error_setg(errp, "virtio_net: couldn't find primary bus"); return false; From patchwork Mon Feb 13 07:04:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 653158 Delivered-To: patch@linaro.org Received: by 2002:adf:f90f:0:0:0:0:0 with SMTP id b15csp2265073wrr; Sun, 12 Feb 2023 23:05:32 -0800 (PST) X-Google-Smtp-Source: AK7set+OC8WJowKm+mNHIVWixtQpcFFSOSgJQB2ul1g+Ba2/9186xnpk0EdSAaPjtPyOIE4zEbVK X-Received: by 2002:a05:6214:e41:b0:56b:7ec7:b158 with SMTP id o1-20020a0562140e4100b0056b7ec7b158mr42289200qvc.36.1676271932108; Sun, 12 Feb 2023 23:05:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676271932; cv=none; d=google.com; s=arc-20160816; b=gpuZ5tKA9W/Mm+WMEX/PD35C+8Xzs9Aph0NeUS7m/QiAM5i25bm+J6vi9BrpBv4e/h AtNwdcf1rvACTNbFoGYEmqiWcfY5r7QN8m/ij3Y7r8MMdhJyoP0c+9aluIbrWFFacsrs GXSsvnb4uPBOqN/k42pREyjo69fialX+yaepxEyZudFXrlyHfkWPSgTyT1GGbEGeF5+2 NoqgL8XPEwywNhagU8NLC0tgPdjSrGJOPApb6625ZylMtESC2XGWdVKeXIJyBDopE5fb oIR20A1XNV4a0eC4d8vqX1EJmpsK9jAxx7a6PvHUpzMuqMjnkHmdSKiRlJwZQrA8/hsH 6YBg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=5xw6YWbqYTi/Ye8J2dXQn81KMiMRy7Drw2jaWnSC+88=; b=Oloft4tM642DcUk4s5StjRzWTfoOIe1pc5zBg3G/hLq4TZZveelxLNsiNKE7ggKLyh TdWVjMXD4LFViEDLyhnxk6LBRxeTIjLZD75Jt51qnjq5f42xvVQk1SW3iBKPDRC7c0/K rrDbFG5jE3ipuwhsKhR21W+1LIVdRlPJ7PmFtFDAmDRPcvkhyKndcgPWSSC8Y8TE+ork /7xpj2EQployqdsEn0jBlcI9Ha8+aocB0f/XYoUJZlwPChvpZhWF2+Luxx5649rvFUkd 30IbK2c3p/mZNhJ25CmKR5A5ahAIAqRHgthfTExySJuXCVr37jQFlSYx9sFlSn+DIXQc gZTA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ioPYMvi6; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id i6-20020a05620a248600b00721bf7bec5fsi9689627qkn.441.2023.02.12.23.05.31 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 12 Feb 2023 23:05:32 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ioPYMvi6; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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) 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-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) 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) From: =?utf-8?q?Philippe_Mathieu-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_Mathieu-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 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org DeviceState::parent_bus is an internal field and should be accessed by the qdev_get_parent_bus() helper. Signed-off-by: Philippe Mathieu-Daudé Acked-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_expander_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 SysBusDevice *dev) assert(position >= 0); pxb_dev_base = DEVICE(pxb_dev); - main_host = PCI_HOST_BRIDGE(pxb_dev_base->parent_bus->parent); + main_host = PCI_HOST_BRIDGE(qdev_get_parent_bus(pxb_dev_base)->parent); main_host_sbd = SYS_BUS_DEVICE(main_host); if (main_host_sbd->num_mmio > 0) { From patchwork Mon Feb 13 07:04:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 653160 Delivered-To: patch@linaro.org Received: by 2002:adf:f90f:0:0:0:0:0 with SMTP id b15csp2265217wrr; Sun, 12 Feb 2023 23:06:00 -0800 (PST) X-Google-Smtp-Source: AK7set9jR9a8eLCWx0Lp8EX3MU91xqTx/w33mvP4rpJ5pjNgVB+m0VsUg1PoIhDbiIMsYufhM89K X-Received: by 2002:a05:6214:2e0c:b0:56e:ab46:c481 with SMTP id mx12-20020a0562142e0c00b0056eab46c481mr5313784qvb.20.1676271959998; Sun, 12 Feb 2023 23:05:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676271959; cv=none; d=google.com; s=arc-20160816; b=hPcxhuyEcW8RvdVANfkpPxwi3722KKy09NJyI5YRVn1HusrWwLpUOqpMvQxPEcMXO/ dYXOPw3wtfWkZovMWsBgXVcas5TdAEoXDAmeCcOasWn2KsFBgukWBX2197WdraJkFcvT +cyj3sRD3QIa3Sg8q7GUM1my8pN3GxGvmOPAPETdo4f0MMsIRvxJvTu7pO9tmOqEQD61 It8eMMd6aOatDe9MAwqj66ft4PNFC7ZYAkL5Bb4yK+colyXiq9P3QSNOGiAAk/o9UhBy miS/hDTHPXmpvI7npw2zveEOt0c3g8Z0Gtc6rBuKbO6GeOJOs3UFL55sYyQL0UxCC6A1 hnWQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=nNOrNrdb50vLty1kgJSdCEtWYQ6pUAsz/+ttGOyu3ag=; b=jKWFAEWOK+5bEnPqMA5pOEbgMaTN9Eh2vGWHeLlgxPjUdP3IN3KE26HGvUHS3MyWoQ rkQh11C2K6nzoJkXVo8yiXjngr/ODJhqECAoHoLM0rsNN/QgCyndLdhhoAukDIl0lumG bcVBCn1066/DI7xGz3qh/agBE2TzsvrTLqJZBhou6Uh3BtgBElEyBkle/cDnnQKowAUA nrp5fu2nseFR/8FbGEkjqHT8N41mMScpV2+t4bmM/d1z5ytmKz3680dbomGxFU2XMnR2 OcrOcjjmQe12tQbox0W1DtVVWxzdig8LTvJ6m8Q3XsQuNbzFBGPsvzxVuq7qye6XHoLu xi9Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=SZHeQUxG; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id g4-20020a0caac4000000b0056bec3001dfsi8033909qvb.412.2023.02.12.23.05.59 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 12 Feb 2023 23:05:59 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=SZHeQUxG; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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) 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-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) 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) From: =?utf-8?q?Philippe_Mathieu-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_Mathieu-Daud=C3=A9?= , Daniel Henrique Barboza , =?utf-8?q?C=C3=A9dric_Le_G?= =?utf-8?q?oater?= , 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 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org DeviceState::parent_bus is an internal field and should be accessed by the qdev_get_parent_bus() helper. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Cédric Le Goater --- 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, SpaprMachineState *spapr, static SpaprVioDevice *reg_conflict(SpaprVioDevice *dev) { - SpaprVioBus *bus = SPAPR_VIO_BUS(dev->qdev.parent_bus); + SpaprVioBus *bus = SPAPR_VIO_BUS(qdev_get_parent_bus(DEVICE(dev))); BusChild *kid; SpaprVioDevice *other; @@ -492,7 +492,7 @@ static void spapr_vio_busdev_realize(DeviceState *qdev, Error **errp) } } else { /* Need to assign an address */ - SpaprVioBus *bus = SPAPR_VIO_BUS(dev->qdev.parent_bus); + SpaprVioBus *bus = SPAPR_VIO_BUS(qdev_get_parent_bus(DEVICE(dev))); do { dev->reg = bus->next_reg++; From patchwork Mon Feb 13 07:04:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 653163 Delivered-To: patch@linaro.org Received: by 2002:adf:f90f:0:0:0:0:0 with SMTP id b15csp2265570wrr; Sun, 12 Feb 2023 23:07:07 -0800 (PST) X-Google-Smtp-Source: AK7set/1JEzha9x46pstUYwo0uDL3iaZI93r/VHfyKJWlLgM9Zd8u+NgYcmUjw0MB6r4K74WV7B/ X-Received: by 2002:ac8:5ac7:0:b0:3b6:2e12:4d25 with SMTP id d7-20020ac85ac7000000b003b62e124d25mr26981433qtd.31.1676272027633; Sun, 12 Feb 2023 23:07:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676272027; cv=none; d=google.com; s=arc-20160816; b=rPycIitw+WA0OS2Nx1Ew0Gh3Rf5mj9hGdhJ6nVFs3zfBfh6gLic0bApsIv35fYAG4g i9/AFqh6hm2o062GZ0SJXxuoUvOUn9xQaVKLlqahRzySeJTmponyLBs3KKU9Fi0+x6do fnB7IWATSvuqBu1qCuHG7GE2r6/3BO2o78RmWKlOgrAhrIEuONSEKfa1LmovJ6b8/0D6 1z4IqbHWFL/tXoH2vBDmKg25BdB/HqeZwwF0BAcRiq8OUCBoiPQrzqISTZdE4A5PYB9j 5sPRLZXpisuPN22T00M7j6rA2vjNQ/pPs25yza4nGyCL9jTprxP/OrIKnjuNd1nut9g2 mOpw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=XdMMeyLfgOiIuUSYaAinlqjnLYWjeQ0Zs9Y9OR16Myc=; b=W0vV/NTX4E4J6fwEJN8n/mhqXIBLWudAkjRIIahCu1K8rCO82d+43UL0KLjTfLP/6X IJnG6wFMjKiYpUrnQh1fAS64R4+87y4hQjInTxgz16OaVPNndnHuTZC5QxYbVKXqQixX fptz67cDDz1jvxAxVEnkctskjnEIq5ItJpJGFJ11/9KjxJ5Vle16pMJ2jPan3Nk4FaRG zNGpWACwalS0OnhH0XKr6Um+OGxojvm2zsKyRdfcZEEHQkmeHKjK60ivbkM4BkrpyEVf T1S7aU/sDwpwDG/qg/Pe/anV8A5TBB+yHjs3Lq1/qT/VhL/PO5goiyQV6lj3GWM8XwiH dUmg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=JLLUVRVf; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id i13-20020ac8488d000000b003b9c19a724bsi7674297qtq.489.2023.02.12.23.07.07 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 12 Feb 2023 23:07:07 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=JLLUVRVf; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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) 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-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) 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) From: =?utf-8?q?Philippe_Mathieu-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_Mathieu-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 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org DeviceState::parent_bus is an internal field and should be accessed by the qdev_get_parent_bus() helper. Signed-off-by: Philippe Mathieu-Daudé --- 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 = USB_DEVICE(qdev); - DeviceState *hcd = qdev->parent_bus->parent; + DeviceState *hcd = qdev_get_parent_bus(qdev)->parent; char *id = qdev_get_dev_path(hcd); 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 = dev->qdev.parent_bus->parent; + DeviceState *hcd = qdev_get_parent_bus(DEVICE(dev))->parent; const USBDesc *desc = usb_device_get_usb_desc(dev); int index = 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 = DEVICE(card); - USBDevice *dev = USB_DEVICE(qdev->parent_bus->parent); + USBDevice *dev = USB_DEVICE(qdev_get_parent_bus(qdev)->parent); USBCCIDState *s = USB_CCID_DEV(dev); Answer *answer; @@ -1210,7 +1210,7 @@ void ccid_card_send_apdu_to_guest(CCIDCardState *card, void ccid_card_card_removed(CCIDCardState *card) { DeviceState *qdev = DEVICE(card); - USBDevice *dev = USB_DEVICE(qdev->parent_bus->parent); + USBDevice *dev = USB_DEVICE(qdev_get_parent_bus(qdev)->parent); USBCCIDState *s = USB_CCID_DEV(dev); 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 = DEVICE(card); - USBDevice *dev = USB_DEVICE(qdev->parent_bus->parent); + USBDevice *dev = USB_DEVICE(qdev_get_parent_bus(qdev)->parent); USBCCIDState *s = USB_CCID_DEV(dev); 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 = DEVICE(card); - USBDevice *dev = USB_DEVICE(qdev->parent_bus->parent); + USBDevice *dev = USB_DEVICE(qdev_get_parent_bus(qdev)->parent); USBCCIDState *s = USB_CCID_DEV(dev); 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 = DEVICE(card); - USBDevice *dev = USB_DEVICE(qdev->parent_bus->parent); + USBDevice *dev = USB_DEVICE(qdev_get_parent_bus(qdev)->parent); USBCCIDState *s = USB_CCID_DEV(dev); s->bmCommandStatus = 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 = DEVICE(card); - USBDevice *dev = USB_DEVICE(qdev->parent_bus->parent); + USBDevice *dev = USB_DEVICE(qdev_get_parent_bus(qdev)->parent); USBCCIDState *s = USB_CCID_DEV(dev); s->bmCommandStatus = COMMAND_STATUS_NO_ERROR; @@ -1275,7 +1275,7 @@ static void ccid_card_unrealize(DeviceState *qdev) { CCIDCardState *card = CCID_CARD(qdev); CCIDCardClass *cc = CCID_CARD_GET_CLASS(card); - USBDevice *dev = USB_DEVICE(qdev->parent_bus->parent); + USBDevice *dev = USB_DEVICE(qdev_get_parent_bus(qdev)->parent); USBCCIDState *s = USB_CCID_DEV(dev); if (ccid_card_inserted(s)) { @@ -1291,7 +1291,7 @@ static void ccid_card_realize(DeviceState *qdev, Error **errp) { CCIDCardState *card = CCID_CARD(qdev); CCIDCardClass *cc = CCID_CARD_GET_CLASS(card); - USBDevice *dev = USB_DEVICE(qdev->parent_bus->parent); + USBDevice *dev = USB_DEVICE(qdev_get_parent_bus(qdev)->parent); USBCCIDState *s = USB_CCID_DEV(dev); Error *local_err = NULL; 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); 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))); } extern const VMStateDescription vmstate_usb_device; From patchwork Mon Feb 13 07:04:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 653166 Delivered-To: patch@linaro.org Received: by 2002:adf:f90f:0:0:0:0:0 with SMTP id b15csp2265637wrr; Sun, 12 Feb 2023 23:07:20 -0800 (PST) X-Google-Smtp-Source: AK7set9NnoqzO9ZMRbE2abuO+MeBZ+HskqHOzMTsPjvFIjpzMtG8URLECB8SF2+7pFaiHtKL0oWv X-Received: by 2002:ad4:5bac:0:b0:56b:f061:c3c6 with SMTP id 12-20020ad45bac000000b0056bf061c3c6mr43993330qvq.33.1676272039975; Sun, 12 Feb 2023 23:07:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676272039; cv=none; d=google.com; s=arc-20160816; b=nReuQ9q/+j8KRl0sW6goyMXe09yr8x4K/sbjbxGYBZUVt8pWMF4utXiKx2gCZahkdU njO39uJloBgX2Myf3WPykLsi6TitYly8a8I+ErtYqFomk5SkU7j72bDTgfHoR/X2QJBm HEXOadZ4KfcbymfyixlttswF7lky93JJN2RhDfG4s3qfdquBJHQOjg7+ee73ErHhve/2 H3jSNIy6GPnLgD+i/D3MUe3BIw6Vk4nWvfg+JlkNpPJt/tH8XKxE/I7zwh/7Hss7pin7 NHYEUg+7C0KM9fGLjoivtNqAiu6VlLijuIv6IM7G5zDGW2h1HXiUBasnT9YG97Abzs23 LFDg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=9E9FEd3Tu+4S+Gw8JExKzSs7Qwdz1/Mjy+Z3v6Jr7cU=; b=udir6j5wcZcCf1vpbZtNE32xpqiqWVEkYnRh+/rPhvWVSPq3D5ojCeA/0b4EcPuEBp 10qLk4gdn7o5xdfURRu6TytvGODOn/PAGFFN0m6IQYLc3URKCZRSqYc1Yn2+oVAtzdWm M4d/mJ7DFOuR3MzEeRZYTaXqp9L899nI95oAQurWZTHZjgVvxhtcFvsJ52SCvs50gkQ9 DrZCT/R+3pKXdIyfkBvmeUY0vwutchVSNx5FmOoDfjpRkSYZhAJNbHeRSGYJOODlCX8E ZaY/yf8eL9Gq+z7BOMuLWWumDRLJy0alF7HG3DpgpXpFcjQluKVhyO0Hb3n0k8SyRmod lwfw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=bUUnjBSK; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id l9-20020a0c9789000000b0056e8ecf84d0si7061771qvd.491.2023.02.12.23.07.19 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 12 Feb 2023 23:07:19 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=bUUnjBSK; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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) 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-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) 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) From: =?utf-8?q?Philippe_Mathieu-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_Mathieu-Daud=C3=A9?= , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=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 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org 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é --- 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, DeviceState *dev) return NULL; } -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 = OBJECT(dev); + BusState *bus = qdev_get_parent_bus(dev); char *d = NULL; while (!d && obj->parent) { @@ -53,11 +54,11 @@ static char *qdev_get_fw_dev_path_from_handler(BusState *bus, DeviceState *dev) return d; } -char *qdev_get_own_fw_dev_path_from_handler(BusState *bus, DeviceState *dev) +char *qdev_get_own_fw_dev_path_from_handler(DeviceState *dev) { Object *obj = OBJECT(dev); - 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); } 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 = qdev_get_fw_dev_path_helper(dev->parent_bus->parent, p, size); - d = qdev_get_fw_dev_path_from_handler(dev->parent_bus, dev); + d = qdev_get_fw_dev_path_from_handler(dev); if (!d) { d = 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); char *qdev_get_fw_dev_path(DeviceState *dev); -char *qdev_get_own_fw_dev_path_from_handler(BusState *bus, DeviceState *dev); +char *qdev_get_own_fw_dev_path_from_handler(DeviceState *dev); void device_class_set_props(DeviceClass *dc, Property *props); 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, bool ignore_suffixes, if (!ignore_suffixes) { if (dev) { - d = qdev_get_own_fw_dev_path_from_handler(dev->parent_bus, dev); + d = qdev_get_own_fw_dev_path_from_handler(dev); if (d) { assert(!suffix); s = d; From patchwork Mon Feb 13 07:04:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 653162 Delivered-To: patch@linaro.org Received: by 2002:adf:f90f:0:0:0:0:0 with SMTP id b15csp2265523wrr; Sun, 12 Feb 2023 23:07:00 -0800 (PST) X-Google-Smtp-Source: AK7set/8FBBOSOFMATt7/YQDr4U7rkn1GPW3X1d+TvjjgX22ncpKBysOI2dyUw18DpmhwixBOu0N X-Received: by 2002:a05:622a:1488:b0:3b6:3a16:a19 with SMTP id t8-20020a05622a148800b003b63a160a19mr40685983qtx.54.1676272020008; Sun, 12 Feb 2023 23:07:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676272019; cv=none; d=google.com; s=arc-20160816; b=CpvHJzHRPIg48xhIc4XpoGpcgDeDD8N9Hrb20qyRlK7glHliuBdTAKc7QX1SAGg0nB W0XYx6yT7XHvbjFrwTM3HrwLQVWLDKUy4xKbdHARcE03OF+gyhk1BNHhJIBDkkiF4Eqf 2L1k0Bv3tPRFhJ+QQj8XtzlGTEPMMdHnGp929qYDfKtyJTT1/J8qwNncXMuXX276e1d3 BWgNBJ8ObHPxhj3oyET9ZwPDHUfqThtu9BbZ7qNK4UOOXtuoI8H1VgCCH6TiR0001LTr 0WWHlnmJlyGDyTaRIvEcRRjXlT+siTeBymfOWTeGawb83r0SwdsBPDhpLMWRE2X1q6zL ZfDA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=md/V7qS9+MXg+4Y+2ycjl2bad9V4Bp92Z+1RWOwRBno=; b=JcCdDGpwisMF6+I4Kx1/FIQq0rO+Nzt9mSB0pNO2RuB20MzY1IbJcQ+KFM2qI7SC8O /vGCNa0MZeq2dYtYvgczXr13KW+159Uaspa2bkXNP7O09/3m8aNVwK9NF+LEwYrr8GNI tlJ8ZSaz6WyzOJHYz6/lWPLNrj9Ewu4/f4VS1yTl0cqNzM69CJgneZlALl8ixldg9qxu jmaJ91fnCvoRpYyMKLVKG1TlpUCTRCQPbj2FOf/Ivln4F1tjv6sT8nfoQU2Uj897QIa4 Ntt8YgZSih9u/D3pYuXfCNx4MJdjq9OKNmKgpXrGzXyQ89IWZn8fSvCLFF5GedJJXibf 32YA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="PxDf/SH2"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id dm7-20020a05620a1d4700b007339c511444si8336259qkb.465.2023.02.12.23.06.59 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 12 Feb 2023 23:06:59 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="PxDf/SH2"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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) 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-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) 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) From: =?utf-8?q?Philippe_Mathieu-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_Mathieu-Daud=C3=A9?= , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=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 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org 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é Reviewed-by: Markus Armbruster --- 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, } } -static void bus_print_dev(BusState *bus, Monitor *mon, DeviceState *dev, int indent) +static void bus_print_dev(Monitor *mon, DeviceState *dev, int indent) { - BusClass *bc = BUS_GET_CLASS(bus); + BusClass *bc = BUS_GET_CLASS(qdev_get_parent_bus(dev)); 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 = object_class_get_parent(class); } while (class != 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); }