From nobody Mon Feb 9 17:36:51 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.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.133.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=1639660861; cv=none; d=zohomail.com; s=zohoarc; b=fQw0kgo/msLJy2Yp7ptKoxiFHmjGDMAsQ89hRmQiBRxsMQx8HYLh20aMnUwk70+7sdWHJU7dWmcDedH3RJDxJuVS+lWV773XY9Iy/1gk3kp06/iXrQG0z2s/DHTg301MlFq4ZymKbtIgJAPn12VY/U8OSbMqarDmlnEovwYBYiY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1639660861; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=XIR/7k3+LEqXkFaBCSIJ9jj6FHOlOGORQLMrHC9gYqo=; b=m1uq2yt8zUGvKZfIZlquykKmGv2xg4RkTcVPUOpGF+J/be5oo7EFl6O5yumRJo2hBs/OF1m7Hb1kJ/JLQw5CoYCwnX/AS8py0Xhc36QZVHdOPbqqsz2Eht0/7FXtIvweU0xEn9Dv3HAF0zm9v23n8DSU2CZChAenO+Ss1T/mHNA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.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.133.124]) by mx.zohomail.com with SMTPS id 1639660861391881.0034525040392; Thu, 16 Dec 2021 05:21:01 -0800 (PST) Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-222-LXMDFOEwMIWiYKW4hWMGrA-1; Thu, 16 Dec 2021 08:20:57 -0500 Received: by mail-wr1-f72.google.com with SMTP id v18-20020a5d5912000000b001815910d2c0so6927952wrd.1 for ; Thu, 16 Dec 2021 05:20:57 -0800 (PST) Return-Path: Return-Path: Received: from localhost.localdomain (174.red-83-50-185.dynamicip.rima-tde.net. [83.50.185.174]) by smtp.gmail.com with ESMTPSA id w25sm5045259wmk.20.2021.12.16.05.20.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Dec 2021 05:20:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1639660860; 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=XIR/7k3+LEqXkFaBCSIJ9jj6FHOlOGORQLMrHC9gYqo=; b=Sp+X6npqfITdqxgNbqkH77bd7sxFwiUrZyH2gNmY8EC0AfqrNzTuKuukMurn9ppe/hrMZd uN9HJXmiycR4Vn+E3G+tQOQZWio6mRFMB3f+lpxUCf4HSZjodVOvXsX0eRzrYy3r1M6bO6 pvDNCWSvWlS4sUKHiKvXJPXOJaP53fI= X-MC-Unique: LXMDFOEwMIWiYKW4hWMGrA-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=XIR/7k3+LEqXkFaBCSIJ9jj6FHOlOGORQLMrHC9gYqo=; b=FiufovYDS1REbZKN2VEjBC8oSyuyB0MRONgDw6sdp95l5tOlFQ+0dZjVD1GIBFt8CF 2Y+Vn7VBk7xwlzKVDkepiGMksvXZwQ7NIuBpzplRHTXRVkQadw5SgqGW96w7i83c7jfs zhf8rar2GiuOAEhgZmJ0ZAXBeylo+g2fciSa4/uee0fP9sWVVL77iuqJE6VO3VjLG54K JHGeVN2VJTKlH0864TfchXwfUZrRp42acvXFMeDkmSHlqaIeVqPGkeDeXJo5MBrhx9SZ 3qVQMD0Xk12TNyJQ6QtgddXCQ0v/Bu5nCGxzVV4c4LspVeBnBimaAxrrbOsHj5RrSDO5 pSSQ== X-Gm-Message-State: AOAM5308h5YqM7X+yDdv3UeykqTfQpY59zBHVLHgPVFcJRPtWZbMnC3V 6ijQIKjLZOM7W7RIaa2SSyGfyOfHQCO5wMe/yb67nKie2JLu/EMjUrHP0vL4WkDqrv6SUPGOg4N Ecb6Zi5/h/SoizA== X-Received: by 2002:a05:600c:b43:: with SMTP id k3mr4914760wmr.159.1639660855820; Thu, 16 Dec 2021 05:20:55 -0800 (PST) X-Google-Smtp-Source: ABdhPJx7U9ulwEmx8HA2/W7bSkCYEuamU6pe/+WHQWJiprLrnjx/99BgT0v2MoxfsRIEgrzN+DUZGA== X-Received: by 2002:a05:600c:b43:: with SMTP id k3mr4914741wmr.159.1639660855649; Thu, 16 Dec 2021 05:20:55 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Eduardo Habkost , Andrew Jones , Richard Henderson , Yanan Wang Subject: [PATCH v6 7/8] tests/unit/test-smp-parse: Constify some pointer/struct Date: Thu, 16 Dec 2021 14:20:14 +0100 Message-Id: <20211216132015.815493-8-philmd@redhat.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211216132015.815493-1-philmd@redhat.com> References: <20211216132015.815493-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: 1639660861970100003 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 395929b66cf..0f98c9509ee 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.33.1