From nobody Mon Feb 9 22:38:13 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1636988389; cv=none; d=zohomail.com; s=zohoarc; b=a6Wp1RKIof04kpBVIBvuW2vOm0MNhJey4PYrletdyZEnxUAPPDdyFjWTdrt4FIJcSxzlrDJ7PS5DFlBsaYnZoPKRx3P+/SNxpWBPmjmsRPPNJlV0w4JajVZ47dnZVJUrpB1ul37MH58C3/TeLjrQEuiXmC3/OV9D7Kv6TTwIdPQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1636988389; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=1cgRYAqM41Px2LriKtMbCkqWrzppnp4Wtl8WLrPbt8g=; b=hRMY0FMZlywnh1lkz9opeqYtEXNXM0OhJ40UWX/2a5E2v6E9g3HYYHCyWQWxsR86VQY/+elR6rowLCB7tc/0B46ZmG8v8JrqnKOn1swUY88r4nlj0WtMM/DXT3CKenv3bfYrJdoRi9TUug3UlcIuf4n115p49Y98G8rx4dis9wM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass header.from= (p=none dis=none) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1636988389844290.6288569079371; Mon, 15 Nov 2021 06:59:49 -0800 (PST) Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-81-LpSBrbi1OKiVIwbOGvcWhw-1; Mon, 15 Nov 2021 09:59:47 -0500 Received: by mail-wr1-f72.google.com with SMTP id q17-20020adfcd91000000b0017bcb12ad4fso3657235wrj.12 for ; Mon, 15 Nov 2021 06:59:47 -0800 (PST) Return-Path: Return-Path: Received: from x1w.redhat.com (62.red-83-57-168.dynamicip.rima-tde.net. [83.57.168.62]) by smtp.gmail.com with ESMTPSA id j40sm16105149wms.16.2021.11.15.06.59.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Nov 2021 06:59:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1636988388; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=1cgRYAqM41Px2LriKtMbCkqWrzppnp4Wtl8WLrPbt8g=; b=ELVEEsGBdZJNFe0Z3pDomqG7jffBYS/zMOvVStCaB+wGlAj8qLkCgiTTgbWkEBv80MAvGY 4LqrVDdj6e8UMoPZIZtNrjxvYFXypegYRuIFEhzbzooKzCpGFFGxpz3HjigD9PYdMKk/TZ CrjmiOgOtblTnJj5L7eecV1XtJvJ9l4= X-MC-Unique: LpSBrbi1OKiVIwbOGvcWhw-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=1cgRYAqM41Px2LriKtMbCkqWrzppnp4Wtl8WLrPbt8g=; b=BC+6NbaoP0605VJB8FtEv3cf3kn1ZTjNZUiACqxPZKY5DS6joA0E778FH7a21BFE3h sdd+uj0wQwKHpaw2wPVdVeVEOuZk6jYa4Sj3waRoOliCcx/6vU1TFGlfK1OsLbpqt6pb KYvKVQYPT9W8vxYFi+45RfuWSj1NiPgDxThlKBE35BEFj8gK58cHwOH4shv0MhKSrYTB SiMw+cnClMT0lK8XgYwFv279wH812+JQwCIJQLoNpRGYd0GgtY7qapuKgrh/tNRBHBrm iBNeHWtfq5Cf5BGbopppUTcd4Tu++fn3f9Z0jel7JCmeBBeH9iYKGLMgbHK737Xpb88k mZ/g== X-Gm-Message-State: AOAM5336SqmCeBInghfU8a+eS1YthNS+zQs1qqLQOqtRUDcB4wRaETN+ 8zIh4ULM2KQeFkv6V2TwJifrKwyDXsirfef3iR6wX79jTuWO+TVWtAZmASj3OAAJ5YzJOFaMjEN qHGO5Y90QOWX7KA== X-Received: by 2002:a1c:cc09:: with SMTP id h9mr45141872wmb.191.1636988386225; Mon, 15 Nov 2021 06:59:46 -0800 (PST) X-Google-Smtp-Source: ABdhPJyMNNqFIDTgepRxco8S6Zh8Jux7IOmBRfYU39T36RKkzsyRIdT1//measUpR5efmESqGx+hwg== X-Received: by 2002:a1c:cc09:: with SMTP id h9mr45141838wmb.191.1636988386025; Mon, 15 Nov 2021 06:59:46 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Markus Armbruster , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Yanan Wang , Andrew Jones , Eduardo Habkost , Thomas Huth , Marcel Apfelbaum , Richard Henderson Subject: [PATCH-for-7.0 v4 10/11] tests/unit/test-smp-parse: Constify some pointer/struct Date: Mon, 15 Nov 2021 15:58:59 +0100 Message-Id: <20211115145900.2531865-11-philmd@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211115145900.2531865-1-philmd@redhat.com> References: <20211115145900.2531865-1-philmd@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=philmd@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1636988391334100001 Declare structures const when we don't need to modify them at runtime. Reviewed-by: Andrew Jones Reviewed-by: Richard Henderson Reviewed-by: Yanan Wang Tested-by: Yanan Wang Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- tests/unit/test-smp-parse.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/unit/test-smp-parse.c b/tests/unit/test-smp-parse.c index 2f3bcf198a5..8f47a2e65f6 100644 --- a/tests/unit/test-smp-parse.c +++ b/tests/unit/test-smp-parse.c @@ -83,7 +83,7 @@ typedef struct SMPTestData { * then test the automatic calculation algorithm of the missing * values in the parser. */ -static struct SMPTestData data_generic_valid[] =3D { +static const struct SMPTestData data_generic_valid[] =3D { { /* config: no configuration provided * expect: cpus=3D1,sockets=3D1,cores=3D1,threads=3D1,maxcpus=3D1 = */ @@ -285,7 +285,7 @@ static struct SMPTestData data_generic_valid[] =3D { }, }; =20 -static struct SMPTestData data_generic_invalid[] =3D { +static const struct SMPTestData data_generic_invalid[] =3D { { /* config: -smp 2,dies=3D2 */ .config =3D SMP_CONFIG_WITH_DIES(T, 2, F, 0, T, 2, F, 0, F, 0, F, = 0), @@ -319,7 +319,7 @@ static struct SMPTestData data_generic_invalid[] =3D { }, }; =20 -static struct SMPTestData data_with_dies_invalid[] =3D { +static const struct SMPTestData data_with_dies_invalid[] =3D { { /* config: -smp 16,sockets=3D2,dies=3D2,cores=3D4,threads=3D2,maxc= pus=3D16 */ .config =3D SMP_CONFIG_WITH_DIES(T, 16, T, 2, T, 2, T, 4, T, 2, T,= 16), @@ -356,7 +356,7 @@ static char *smp_config_to_string(SMPConfiguration *con= fig) config->has_maxcpus ? "true" : "false", config->maxcpus); } =20 -static char *cpu_topology_to_string(CpuTopology *topo) +static char *cpu_topology_to_string(const CpuTopology *topo) { return g_strdup_printf( "(CpuTopology) {\n" @@ -372,7 +372,7 @@ static char *cpu_topology_to_string(CpuTopology *topo) } =20 static void check_parse(MachineState *ms, SMPConfiguration *config, - CpuTopology *expect_topo, const char *expect_err, + const CpuTopology *expect_topo, const char *expect= _err, bool is_valid) { g_autofree char *config_str =3D smp_config_to_string(config); @@ -466,7 +466,7 @@ static void smp_parse_test(MachineState *ms, SMPTestDat= a *data, bool is_valid) } =20 /* The parsed results of the unsupported parameters should be 1 */ -static void unsupported_params_init(MachineClass *mc, SMPTestData *data) +static void unsupported_params_init(const MachineClass *mc, SMPTestData *d= ata) { if (!mc->smp_props.dies_supported) { data->expect_prefer_sockets.dies =3D 1; --=20 2.31.1