From patchwork Sun Feb 12 22:47:30 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: 652830 Delivered-To: patch@linaro.org Received: by 2002:adf:f90f:0:0:0:0:0 with SMTP id b15csp2123351wrr; Sun, 12 Feb 2023 14:49:04 -0800 (PST) X-Google-Smtp-Source: AK7set+49kpCiugwgd5jWdWKr6NFppbvM9He2F2sGbpPNCQQA/fgC1sfkVwnH8zwcPUAnDE1chji X-Received: by 2002:a05:622a:208:b0:3b6:334b:2cbc with SMTP id b8-20020a05622a020800b003b6334b2cbcmr38417369qtx.65.1676242144767; Sun, 12 Feb 2023 14:49:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676242144; cv=none; d=google.com; s=arc-20160816; b=tPs4SrjlolHKOG8014R3o3szZo6RSmZn80RVFNDAWrlL0LFl5CyIVx8F12LvlA9XTP tPAOA4KOII1u+e2FRyhEIKcKhgp00ToGmcewOjWreDhmzM2RZlWdyhInDQV0O6s/k9rU uBx86OfAFAQHGEHzoLtWcWESoXyMCrZXRHRukLu69MC2T6/3EH3us0tQQqlmEsPM+WSq jGqqZBRoHX/kttOBHdRjqsaJyYso3rMWbXrRiCYHM3E4flkNYe77fiB41MEwh65rtKfM B5LdVxSDSEywSTFr0BFSUM3dWBmlPuhpED5LxwwbZ9MptiZLnTAHlUfwe9qFbnBD2FxU cErg== 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=Qt2YkzwYr4CuRV1RUpO5AOgHyW/9PMRakSt5/qRRY0Oxullw2dwLtGWt6UwP+/lQJw D7hP4DT+n26rq18eGgwYq6O+HZ+Q/vc36/6Fil2sCgvKOfV71cPQnqQwOLum8ZIMPC/C MGkVIEngRdS0QkbTAGoKUUB1RfJUo+XMwMiZCaUBSPRMiyFI0CBVLsJ+O53C5/S9AgQh oLTmKhutDKmDty2dhie7ZRFHoX5Eq2OZKULtcKbSGaBZfuPMe93ah8FyGuRvdjjx8nmI v/YX50IyFrjBl3VwElq0x1OFZ2JKPI8YZlbX+S4ekhl1Wyif6RRCKoWtd/1i2U0ectSJ i+6w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=OmzXMfDg; 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 x11-20020a05622a000b00b003b62c3eb9b1si8348566qtw.572.2023.02.12.14.49.04 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 12 Feb 2023 14:49:04 -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=OmzXMfDg; 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 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) 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-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) 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) From: =?utf-8?q?Philippe_Mathieu-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_Mathieu-Daud=C3=A9?= , =?utf-8?q?Dani?= =?utf-8?q?el_P=2E_Berrang=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 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+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: 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, } } -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); }