From nobody Tue Nov 26 06:24:19 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass header.i=@intel.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linux.intel.com ARC-Seal: i=1; a=rsa-sha256; t=1709718265; cv=none; d=zohomail.com; s=zohoarc; b=TCL68hSqYXOlb0Gf0t8EAagk/t5ClgXvpH6/M+qJ1QGHUMVMDZJFImAV/fTaSmXePZlofn1EEg64qIN5Ylm+hnL359TQ8zP7hM4NccUbEbbvWjib3zr58dvg2m7Ut7M/oirq4pbF9EiXeOAJB0KgnrUO8e7LotAeLghJwYyZukg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1709718265; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=uQuqqKb3ttofAAwKxS7kS6hWX3HPb9WWuOsPAkUUxak=; b=II0kV4d0cZez1cYDzhryBg2rRXsWM8cZt52YHVqJ5nXYN4Asn8GL4Lp3YPwMTCpI8li/EvfAuqMC6ZVLndgYNihShNjtLvbmZ50N6p4fdG1U5/ANgSxxAyZE8SEr8lAntV/Q35M1mzjfj6ez4MwaNcDDzNyFsyl1P+2SojQElno= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=@intel.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1709718265559355.7696672064267; Wed, 6 Mar 2024 01:44:25 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rhnlQ-0007Py-On; Wed, 06 Mar 2024 04:40:40 -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 1rhnlP-0007Pi-Bu for qemu-devel@nongnu.org; Wed, 06 Mar 2024 04:40:39 -0500 Received: from mgamail.intel.com ([198.175.65.11]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rhnlN-00025v-ED for qemu-devel@nongnu.org; Wed, 06 Mar 2024 04:40:38 -0500 Received: from fmviesa002.fm.intel.com ([10.60.135.142]) by orvoesa103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Mar 2024 01:40:36 -0800 Received: from liuzhao-optiplex-7080.sh.intel.com ([10.239.160.36]) by fmviesa002.fm.intel.com with ESMTP; 06 Mar 2024 01:40:33 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1709718037; x=1741254037; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=0Oqv2Y548yUJEQ3jZWHP1266B+OXZuHqGaMfM6j07uY=; b=LE6KjFnJvhCeLYt15oMiKTOmSFzo+duvXF+Y++HPKuNJuFT0BDd2oAnW xaDqjyNhGKPuikHFVh5u1b+7Z3fmNxXS0xOY/f118UkqJe6lF4FA1CJS2 BzPRXbvaH6F43ipgZU4x5XHjdQlaUmkDnwPOTzHtZ6OVcCiJPo+2jC9XV qfRQflCeXJuuoM2kVFtLMo7XFKxoRmY1hxWrcReFqMvdy4j9v/4XVRvW9 xtZx9Y4cIGfjH5QeFNoAJE5CBaTuZtzBi8m8c815ZTgfZQb2ARq3A4ZVX pTG0m2gmoS94DrMWgBXjrgeuR+BsB8aEwMDBYbG0urI3AJmcGK1JlYLpO Q==; X-IronPort-AV: E=McAfee;i="6600,9927,11004"; a="14897833" X-IronPort-AV: E=Sophos;i="6.06,207,1705392000"; d="scan'208";a="14897833" X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.06,207,1705392000"; d="scan'208";a="32854134" From: Zhao Liu To: Eduardo Habkost , Marcel Apfelbaum , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Yanan Wang , =?UTF-8?q?Daniel=20P=20=2E=20Berrang=C3=A9?= , Thomas Huth , Igor Mammedov , Prasad Pandit , qemu-devel@nongnu.org Cc: Xiaoling Song , Zhao Liu , Prasad Pandit Subject: [PATCH 03/14] hw/core/machine-smp: Simplify variables' initialization in machine_parse_smp_config() Date: Wed, 6 Mar 2024 17:53:56 +0800 Message-Id: <20240306095407.3058909-4-zhao1.liu@linux.intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240306095407.3058909-1-zhao1.liu@linux.intel.com> References: <20240306095407.3058909-1-zhao1.liu@linux.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: none client-ip=198.175.65.11; envelope-from=zhao1.liu@linux.intel.com; helo=mgamail.intel.com X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.568, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @intel.com) X-ZM-MESSAGEID: 1709718266450100001 Content-Type: text/plain; charset="utf-8" From: Zhao Liu SMPConfiguration initializes its int64_t members as 0 by default. Therefore, in machine_parse_smp_config(), initialize local topology variables with SMPConfiguration's members directly. Suggested-by: Prasad Pandit Signed-off-by: Zhao Liu --- hw/core/machine-smp.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/hw/core/machine-smp.c b/hw/core/machine-smp.c index 50a5a40dbc3d..3d9799aef039 100644 --- a/hw/core/machine-smp.c +++ b/hw/core/machine-smp.c @@ -82,15 +82,15 @@ void machine_parse_smp_config(MachineState *ms, const SMPConfiguration *config, Error **errp) { MachineClass *mc =3D MACHINE_GET_CLASS(ms); - unsigned cpus =3D config->has_cpus ? config->cpus : 0; - unsigned drawers =3D config->has_drawers ? config->drawers : 0; - unsigned books =3D config->has_books ? config->books : 0; - unsigned sockets =3D config->has_sockets ? config->sockets : 0; - unsigned dies =3D config->has_dies ? config->dies : 0; - unsigned clusters =3D config->has_clusters ? config->clusters : 0; - unsigned cores =3D config->has_cores ? config->cores : 0; - unsigned threads =3D config->has_threads ? config->threads : 0; - unsigned maxcpus =3D config->has_maxcpus ? config->maxcpus : 0; + unsigned cpus =3D config->cpus; + unsigned drawers =3D config->drawers; + unsigned books =3D config->books; + unsigned sockets =3D config->sockets; + unsigned dies =3D config->dies; + unsigned clusters =3D config->clusters; + unsigned cores =3D config->cores; + unsigned threads =3D config->threads; + unsigned maxcpus =3D config->maxcpus; =20 /* * Specified CPU topology parameters must be greater than zero, --=20 2.34.1