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. ***/