From patchwork Fri Feb 3 10:12: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: 650020 Delivered-To: patch@linaro.org Received: by 2002:a17:522:d8c:b0:4be:c3dc:14d8 with SMTP id d12csp733446pva; Fri, 3 Feb 2023 02:13:30 -0800 (PST) X-Google-Smtp-Source: AK7set9S/TNoByyDdx/GUQMrADremNJUONI0dCf7sciyZPFxJbgBxeGx0SdN2PUPdq5pF0pBiqV9 X-Received: by 2002:a05:622a:188e:b0:3b6:30ea:e95 with SMTP id v14-20020a05622a188e00b003b630ea0e95mr16321513qtc.18.1675419210158; Fri, 03 Feb 2023 02:13:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675419210; cv=none; d=google.com; s=arc-20160816; b=zwiFgRcv7sr/4c8tCAn1kodR2LpWVq7y9p6H9gSo4yBLoJKmvV46gQBGub2YTWreeO FAePd2YyTEOr2PdYibJbFH9k7wOLndS2aexOSedOWlgL7EniP1OI8jHWdAHoQ49ujGwN maJqnJey0Lil0HM+wpDs8sLCVnXiYkeQrGekTFVxuCJVE2yXn4xDPTIiM6n2G3AHdMUC IPa4btgXBddapUaj1cOO0X+0Va0unW/IxFNHAzwxwYCw6sA1ZUjpfwjoof5lYwyUFFhC LBasMU4X4DWQNEh2HD56ZsFp6fW9Hvw7JCNTv2iz+cYOeCCqKx9Qa2KO2ORh+wxxWjVB J7aw== 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=2FPU8hqewqby+6DslWjG6sYp4oJe8crQF3hcWKmfIIg=; b=BDDHHhp8B6u5/5YOavfT1nME+ADUtR+N+e44xNh9BkRHjQBG8bP/zHbynbqLdxzLeu ntRLh6jGDtzkcTQ06A97Ezw9UzehwYZfXAU+B7TXzUCTXWTj3IOisHHT6qh5Tt7mVA28 J7kYzrTzCcrXyH+IUfNE/HsyTrYc3zh/5CxPEANnvoAGwjAJXd4TC3uKyOxxKP7MIX7O PCqUpXCK5Bi3JrUQ/6EtrEblXC9C9LUe6P5w2WippblZ7fD7yqqcNwh1BkeHiizbayq9 udpxTGUGLgArcTuoBmFmoE6B2col1g1NA406GqVu6qrdi97QyhpAG8kzCISikupKlJnE HQUg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=dYYulEIF; 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 w7-20020a05622a190700b003b86c04d598si1630712qtc.723.2023.02.03.02.13.30 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 03 Feb 2023 02:13: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=dYYulEIF; 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 1pNt3u-0008Nm-K0; Fri, 03 Feb 2023 05:12: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 1pNt3g-0008LR-79 for qemu-devel@nongnu.org; Fri, 03 Feb 2023 05:12:41 -0500 Received: from mail-wr1-x42d.google.com ([2a00:1450:4864:20::42d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pNt3e-0002Fu-ET for qemu-devel@nongnu.org; Fri, 03 Feb 2023 05:12:39 -0500 Received: by mail-wr1-x42d.google.com with SMTP id bk16so4149827wrb.11 for ; Fri, 03 Feb 2023 02:12:38 -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=2FPU8hqewqby+6DslWjG6sYp4oJe8crQF3hcWKmfIIg=; b=dYYulEIFPBC87aUd9KEbUMujovwFfFH/mIdIaP7LwyEUV84+y0XSU09HHBTvHRRZ9Z u3nn+xQP2eGsSjJEY1B7EyBSS/7EpI7pViIZt2J+qHi3WOLiCXGfXqOqJLKQCs4CDmIb TYg9yXfgLvHHKou09dG9w+Glxo4VXT3VF9fgUvhFTbLKA24ze2omwYwji/Ja//t1I1YH bBnOvWurZS5WeBwLgNeB9Mnii/x9jWK1HZeKuPhOplDIHJifyUUnJblkFGC7WknVmggx UG9XvVmEq4RMb/19AzrBbnUQ9Yt5QiJbskJCLjsgjwLFIv/kiyaVzt2HgdDjZh3KLoP1 NjMg== 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=2FPU8hqewqby+6DslWjG6sYp4oJe8crQF3hcWKmfIIg=; b=heZJX5IAcVBpm5AGnZ1wwUa0WNeMezd70nllXigWn9Zg1EtYHIDpvN7FfAFLk/cwQC 6ECi7SL0cQqLxXRTqfw1QxnvA5CKLlxLLfCTG7iPrhQI/TZ/1RdXiJZklp03rMBn4ajm dFn5JVmqh7AKRPyAPusdVLMdYvsrPsP6RLkKdWAIpC8fcIn+bHOkbUeC0N6RB5+avB+X hwSQlSKNtWPz7KmhDLaZv7kYWJ3O6DFMH8f4gOXBGJPUwu1MJn8NvR6rsTLLFE1r12es tqz4pinTNzl+2JBd4prd5pxWq+BlFSYAz/fL4EaPv274B1x2gW2Ei4J8dBaEEHAuayHZ HPHQ== X-Gm-Message-State: AO0yUKX8FeUcx7kHbRUCeSiIEyPCDKqMXaSREBroMIipOQtKrP6iBaTb FDa6yuHKs+r7mIHZPQSXt2ExF4PINZZyOg7Q X-Received: by 2002:a05:6000:384:b0:2bf:db79:4c6e with SMTP id u4-20020a056000038400b002bfdb794c6emr11976086wrf.63.1675419156978; Fri, 03 Feb 2023 02:12:36 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id m10-20020a5d624a000000b002c3ce97ec38sm1402383wrv.115.2023.02.03.02.12.36 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 03 Feb 2023 02:12:36 -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 2/4] hw/qdev-properties: Constify Property* in PropertyInfo::print() handler Date: Fri, 3 Feb 2023 11:12:22 +0100 Message-Id: <20230203101224.25796-3-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::42d; envelope-from=philmd@linaro.org; helo=mail-wr1-x42d.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-system.c | 2 +- include/hw/qdev-properties.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/core/qdev-properties-system.c b/hw/core/qdev-properties-system.c index d42493f630..a982de1354 100644 --- a/hw/core/qdev-properties-system.c +++ b/hw/core/qdev-properties-system.c @@ -799,7 +799,7 @@ invalid: g_free(str); } -static int print_pci_devfn(Object *obj, Property *prop, char *dest, +static int print_pci_devfn(Object *obj, const Property *prop, char *dest, size_t len) { int32_t *ptr = object_field_prop_ptr(obj, prop); diff --git a/include/hw/qdev-properties.h b/include/hw/qdev-properties.h index b5a0ab34f3..39959c3432 100644 --- a/include/hw/qdev-properties.h +++ b/include/hw/qdev-properties.h @@ -34,7 +34,7 @@ struct PropertyInfo { const char *description; const QEnumLookup *enum_table; bool realized_set_allowed; /* allow setting property on realized device */ - int (*print)(Object *obj, Property *prop, char *dest, size_t len); + int (*print)(Object *obj, const Property *prop, char *dest, size_t len); void (*set_default_value)(ObjectProperty *op, const Property *prop); ObjectProperty *(*create)(ObjectClass *oc, const char *name, Property *prop);