From nobody Tue Feb 10 03:44:38 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=1639586982; cv=none; d=zohomail.com; s=zohoarc; b=GtQU6ZMW9BLS0dysSfySN7OxXZ6gseed8zA5CTKRi4+BNwylklz9TrJMgZEXK7lvgnhavDG0Xo1k66iVih7s/cTqwVTgTeLNrzg3OZdmVxTM96FEEdJLjzWxhQTP3KUp5x0BIzRgBvWyzkfOKw77xDorPtyfN9nYWDJwLBlve5U= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1639586982; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=qKTQTHa1hb0SLmS1AjA4KYFgifkhSYsgZCXWCGHH/MU=; b=fBRZokuWtOIiBZX9aKuF+S1Il0aQ/zV0KUslbTGI6L0jPSFJGBSslKx9sV0EOg1faggMgHoiTQzak42xoildwjbqtpoZWFXBTxQDn9Mm3qnnjtX7X1J4ARgtafWQFUIOPAJNcUjaaWYu2vBFFZGVUnE4HFwKPMRf4LT3HPM4Xnc= 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 1639586982345628.1124298498869; Wed, 15 Dec 2021 08:49:42 -0800 (PST) Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-554-CIUSj0MYOfSpQbVTqrQHEg-1; Wed, 15 Dec 2021 11:49:38 -0500 Received: by mail-wr1-f71.google.com with SMTP id b1-20020a5d6341000000b001901ddd352eso6113415wrw.7 for ; Wed, 15 Dec 2021 08:49:38 -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 z15sm2333023wrr.65.2021.12.15.08.49.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Dec 2021 08:49:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1639586981; 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=qKTQTHa1hb0SLmS1AjA4KYFgifkhSYsgZCXWCGHH/MU=; b=FW7CQpZTJ/uxQk6ndI4fFr32hFSJqyowIyR2IlCpapdHhey+9lfRac3PBlzbnmGqCPyMaM amhiDgXr4BBVwEglkGCJaZ6uKzgqGolSVjtKCYgZSQPm/a1PZGSre2uWfHWhnIlzx871Ha TZYdfZcE/2QyQFJEEDvgu1mylpCTAbM= X-MC-Unique: CIUSj0MYOfSpQbVTqrQHEg-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=qKTQTHa1hb0SLmS1AjA4KYFgifkhSYsgZCXWCGHH/MU=; b=y2oat0rjS830GBFfxqRl1LpPOenqJr0xvUTBgc4C7ln+WlYgKaj3k8313vGk5J3mwG 1NPvsggUaEjR1M1fEP+RUfN/SroPKSoRIlqPjsZ4ly76xEsYMqKd2eeOlsQZO/abcQyo 8TkLfaJCbjjY4/NHyjHvn0NllH5CZLO8+WhBzdQ16ZSMLl8EOfT0uZFE53uapwJSLYyk RxWefgwQQRnYYjPWTXRKuScpE+i4JEUWNJ9bekZfgOhdxns0D94dxJIftO6i97Gz5jtL u52IYgDFerwRzr2H043ncqV+Lk0b0kQAkrZSrbI/fmWsDncQ/X/H/aP462f/heGAwbyj GOZg== X-Gm-Message-State: AOAM532g4RBNxC/CqiNhWRULIVFk9pA34L++fiVbIWpGh1FLIMlSPeoJ VfrFjmDf/UrjbXYOOFXuXusiJlEVshlGVDsq+5KiEVNKKa/0niLIg2rpG4SJxbMQyxvdFDV/mxR 6mnKNux1gZUF78w== X-Received: by 2002:a5d:4e92:: with SMTP id e18mr5327174wru.89.1639586977027; Wed, 15 Dec 2021 08:49:37 -0800 (PST) X-Google-Smtp-Source: ABdhPJzJo3BmYeKI5A5faSWgVV4zxE03y+Be0PSzuG2dBR73uIYvIM1HLURPQluw+jS1AbmQIlFYzQ== X-Received: by 2002:a5d:4e92:: with SMTP id e18mr5327158wru.89.1639586976864; Wed, 15 Dec 2021 08:49:36 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Eduardo Habkost , Marcel Apfelbaum , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Andrew Jones , Richard Henderson , Yanan Wang Subject: [PATCH v5 7/8] tests/unit/test-smp-parse: Constify some pointer/struct Date: Wed, 15 Dec 2021 17:48:55 +0100 Message-Id: <20211215164856.381990-8-philmd@redhat.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211215164856.381990-1-philmd@redhat.com> References: <20211215164856.381990-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: 1639587012168100001 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 251c83c60c2..1f26edc5f82 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