From nobody Tue Feb 10 19:10:24 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1529013171497721.4234122486414; Thu, 14 Jun 2018 14:52:51 -0700 (PDT) Received: from localhost ([::1]:43168 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fTaAf-0008Tu-Hc for importer@patchew.org; Thu, 14 Jun 2018 17:52:45 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47530) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fTa8T-0007IS-4T for qemu-devel@nongnu.org; Thu, 14 Jun 2018 17:50:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fTa8O-00020U-9E for qemu-devel@nongnu.org; Thu, 14 Jun 2018 17:50:29 -0400 Received: from 10.mo69.mail-out.ovh.net ([46.105.73.241]:47829) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fTa8N-0001z6-Qu for qemu-devel@nongnu.org; Thu, 14 Jun 2018 17:50:24 -0400 Received: from player157.ha.ovh.net (unknown [10.109.122.108]) by mo69.mail-out.ovh.net (Postfix) with ESMTP id 4DF6B185FB for ; Thu, 14 Jun 2018 23:50:22 +0200 (CEST) Received: from bahia.lan (lns-bzn-46-82-253-208-248.adsl.proxad.net [82.253.208.248]) (Authenticated sender: groug@kaod.org) by player157.ha.ovh.net (Postfix) with ESMTPA id 24B2B5000A3; Thu, 14 Jun 2018 23:50:17 +0200 (CEST) From: Greg Kurz To: qemu-devel@nongnu.org Date: Thu, 14 Jun 2018 23:50:11 +0200 Message-ID: <152901301117.252222.1572533397608306446.stgit@bahia.lan> In-Reply-To: <152901299450.252222.14219708016930421485.stgit@bahia.lan> References: <152901299450.252222.14219708016930421485.stgit@bahia.lan> User-Agent: StGit/0.17.1-46-g6855-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Ovh-Tracer-Id: 16365518099405445515 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedthedrleeggddtgecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfqggfjpdevjffgvefmvefgnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 46.105.73.241 Subject: [Qemu-devel] [PATCH 1/5] spapr_cpu_core: convert last snprintf() to g_strdup_printf() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-ppc@nongnu.org, =?utf-8?q?C=C3=A9dric?= Le Goater , David Gibson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Because this is the preferred practice in QEMU. Signed-off-by: Greg Kurz --- hw/ppc/spapr_cpu_core.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/hw/ppc/spapr_cpu_core.c b/hw/ppc/spapr_cpu_core.c index 7e3a9e78d090..27602245fd55 100644 --- a/hw/ppc/spapr_cpu_core.c +++ b/hw/ppc/spapr_cpu_core.c @@ -190,7 +190,7 @@ static void spapr_cpu_core_realize(DeviceState *dev, Er= ror **errp) =20 sc->threads =3D g_new(PowerPCCPU *, cc->nr_threads); for (i =3D 0; i < cc->nr_threads; i++) { - char id[32]; + char *id; CPUState *cs; PowerPCCPU *cpu; =20 @@ -208,8 +208,9 @@ static void spapr_cpu_core_realize(DeviceState *dev, Er= ror **errp) /* Set NUMA node for the threads belonged to core */ cpu->node_id =3D sc->node_id; =20 - snprintf(id, sizeof(id), "thread[%d]", i); + id =3D g_strdup_printf("thread[%d]", i); object_property_add_child(OBJECT(sc), id, obj, &local_err); + g_free(id); if (local_err) { goto err; }