From patchwork Fri Feb 3 10:12: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: 650018 Delivered-To: patch@linaro.org Received: by 2002:a17:522:d8c:b0:4be:c3dc:14d8 with SMTP id d12csp733330pva; Fri, 3 Feb 2023 02:13:16 -0800 (PST) X-Google-Smtp-Source: AK7set9HVQyCKpPV8yW8J+s2qRUJd1zcwkxokejBHy/BdVChBuVj9bu4bpfSvhB+gcFWZwcBCcvE X-Received: by 2002:ac8:7c54:0:b0:3b9:b43e:5733 with SMTP id o20-20020ac87c54000000b003b9b43e5733mr18163240qtv.61.1675419195860; Fri, 03 Feb 2023 02:13:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675419195; cv=none; d=google.com; s=arc-20160816; b=qMDnOY4oj1YAC3DoGi4qZWY6MObHSSHg4vTUD7nxM/pwktaIwLPlc9wFt3T9cX11oi FMoLKvFtWVVQcuk/5cU9QQqC3hyfU/uFNLyhtmtE3jSZZgpwfMchROlB8Rw7x03uEWi1 sLTFBT9aKM4v7voKoKbIC+Tlde/245Tr8hcYRwbUkNywdff+8kjj3ie8Ilfls8zX3st0 wJFF3qMoHJiiego3/hJTztCul9eXO/cMaY4z140zQUBrQ3WKClvH1kmpoAlidO3GTdcB 4vM3ysms2eLIyn/Xvjpou9W9vvoP7DkI8K2XM/MqmWHjEfIYpM5CuA1kq+uRK4tPouYH GR/A== 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=CrEmjsQWUs+O54UNiVqyUtKQaK97UySf4g9leluZ4II=; b=fz4Lf06ES3+WDGe8fP7dnwWFi6gGA9m8bPzFJtByO578IS0UblNTdNohJpG03xullp dz2FZQm0ULEsuSZ04IPfNBfGb756mrr8QqRG8ZccMSI1S2lx2/2OLUtkSO5EIZSdftPE Sfpbdx4FxZ4Jd84d2zUVEkpU6zur54uZ8OzUXC77zA45ceu4ztkWAviz/1QevVfFuZZ9 tdiGwZM/u6dYIqTwj5vxvMkkCeJAGpwvQCdmad2jwB7mxtUdbLb5rmrc5OOJxzLqan1t y6/Bg4w+8q7Bvzodkn96iP+TAG7idz29tV9BUAuwSbt3K4j3clyMkiym20gIE256UTw3 zzZw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=QQwOg9vl; 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 204-20020a3703d5000000b00706b15a6e8fsi1748130qkd.578.2023.02.03.02.13.15 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 03 Feb 2023 02:13:15 -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=QQwOg9vl; 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 1pNt3i-0008Lp-G0; Fri, 03 Feb 2023 05:12:43 -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 1pNt3c-0008J3-89 for qemu-devel@nongnu.org; Fri, 03 Feb 2023 05:12:38 -0500 Received: from mail-wr1-x42a.google.com ([2a00:1450:4864:20::42a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pNt3Z-0002F4-Uk for qemu-devel@nongnu.org; Fri, 03 Feb 2023 05:12:36 -0500 Received: by mail-wr1-x42a.google.com with SMTP id a2so3893609wrd.6 for ; Fri, 03 Feb 2023 02:12:33 -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=CrEmjsQWUs+O54UNiVqyUtKQaK97UySf4g9leluZ4II=; b=QQwOg9vlwpGMppX49RZ7vpgn7E0+iLi5zWjDrbtM7B9hAOEq3bI8N0OgO/8UmCOVB4 VQPzh7FQ9wv3wVAk4yz6uC1qX+2xI8N/TT7EkD41A3dUKQUX2ccB4GDw5BLvP7D8y3Bs AM44GHLv7fZi39+PqR0h3L5MXBXpNIsoQXxlO/7O3gr6NjG8HQxm1IqcvAhI9oGVXZi7 1n+JssDgT2dNgB0tSRGuvPqg4Xu18WbuuyaBqeWeCDRrXhD94uYlfCHylK3zXxsm32Hw n0/s+vQ8Z3bbzwWrCw38WH7KPfB65DpOiXgnxVCQSGDdgelp2bTX99xSgMpBgAMKtfFw XsqQ== 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=CrEmjsQWUs+O54UNiVqyUtKQaK97UySf4g9leluZ4II=; b=HqwbLxSHA1alne9bDgycU0Z45yfdwxBaeTdVUMyvIlv02KTUMqXEZUEw6Q6SXgGaN0 bbBHUv91puyM/GzMzAf8ChEp23lQS3qcbqQfE0N651B/LVoDCIxhJAI9moqZZjKx0Th8 9ssCJZWjWfcgtY085zuhlWY50tm6OCThUHsLu+6r/AnWsD4y1j9pEKl+8E+yn6UXisGj DAqBakPBJsMou3IlPo+imUWk4Es5DAYZ1rMoAfVRK1H20QxjoXV4occWRtjIHc/5ryDC ZZRAcR/9eJ7Qfa0MothaPTG5d6Nt/fojac3/yV7utrrmqn2I+mhqaltcEKssE401GToX hnKg== X-Gm-Message-State: AO0yUKX8xtqfwd5ufcs2lKRqk9Lz3Zf1iwUkCc8/mQL8x5CfnmbO472I QUEpXQBStGiKAq9r3+g7S94RlfyFtSP7eZx9 X-Received: by 2002:adf:8912:0:b0:2bf:e692:2636 with SMTP id s18-20020adf8912000000b002bfe6922636mr9049032wrs.26.1675419152301; Fri, 03 Feb 2023 02:12:32 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id bv20-20020a0560001f1400b002bc8130cca7sm1586794wrb.23.2023.02.03.02.12.31 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 03 Feb 2023 02:12:31 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Eduardo Habkost , qemu-trivial@nongnu.org, =?utf-8?q?D?= =?utf-8?q?aniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Phili?= =?utf-8?q?ppe_Mathieu-Daud=C3=A9?= Subject: [PATCH 1/4] hw/qdev-properties: Constify Property* in object_field_prop_ptr() Date: Fri, 3 Feb 2023 11:12:21 +0100 Message-Id: <20230203101224.25796-2-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230203101224.25796-1-philmd@linaro.org> References: <20230203101224.25796-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42a; envelope-from=philmd@linaro.org; helo=mail-wr1-x42a.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 pointed Property structure is accessed read-only. Signed-off-by: Philippe Mathieu-Daudé --- hw/core/qdev-properties.c | 2 +- include/hw/qdev-properties.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/core/qdev-properties.c b/hw/core/qdev-properties.c index 357b8761b5..858c33830c 100644 --- a/hw/core/qdev-properties.c +++ b/hw/core/qdev-properties.c @@ -50,7 +50,7 @@ void qdev_prop_allow_set_link_before_realize(const Object *obj, } } -void *object_field_prop_ptr(Object *obj, Property *prop) +void *object_field_prop_ptr(Object *obj, const Property *prop) { void *ptr = obj; ptr += prop->offset; diff --git a/include/hw/qdev-properties.h b/include/hw/qdev-properties.h index e1df08876c..b5a0ab34f3 100644 --- a/include/hw/qdev-properties.h +++ b/include/hw/qdev-properties.h @@ -206,7 +206,7 @@ void qdev_prop_set_macaddr(DeviceState *dev, const char *name, const uint8_t *value); void qdev_prop_set_enum(DeviceState *dev, const char *name, int value); -void *object_field_prop_ptr(Object *obj, Property *prop); +void *object_field_prop_ptr(Object *obj, const Property *prop); void qdev_prop_register_global(GlobalProperty *prop); const GlobalProperty *qdev_find_global_prop(Object *obj,