From patchwork Tue Feb 25 12:47:03 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 183827 Delivered-To: patch@linaro.org Received: by 2002:a92:1f12:0:0:0:0:0 with SMTP id i18csp1709380ile; Tue, 25 Feb 2020 04:50:30 -0800 (PST) X-Google-Smtp-Source: APXvYqxoa8+1h4nww7llb8uHlz7c+ZJIlkp9s/wwdWae0zbF5qXn1WMbPYZCcd7lsVUVFWtzHH5H X-Received: by 2002:ac8:38c7:: with SMTP id g7mr52274673qtc.229.1582635030410; Tue, 25 Feb 2020 04:50:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582635030; cv=none; d=google.com; s=arc-20160816; b=KU5KTXKumRj5kU4gxMX8Iab4y5OVvT3zY0KZ614wmn7MVauQ900tdhSKHraXwi1Z+9 xtcdLf3cqHUfUIIwXvU51PPMBnkjC9jwWO7DJK7rUl4dHTrmSf+TY3RxDXMvm8hrt8FK 1qp5JnKGvb6wEbNLfMURoXemlmWJfZJzTEVHE2/e8ZYRuh9wTzQL3WAvwK4wE3fw2O1X WJZTIvUvM5uipcC05BE+7bK0TnaHhWQ7KeAp+DdjFJnWBaCDi1jBIVZbCic75ZE8HvXy /Rj0IYcz6lnhGZSxK6usf7qlS9RA7GK627nDi/73mq2shXOIdIT9YggkvUv7c4T+Pe+K BNHQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=PR3MIDvz3PtDDaollGFXmkX1Ue3lMr6ulNQeQQNdSxU=; b=NnfY0aFH561RR4JgtlHUoOVkeIl0OVvvl3+lsgq+IAE2tkaAuaeUSxXfG9+f/goo7Z 9lSvSHwjNz+BskLothV3q/I/81kJtWuh9ahSEvG3eOiAoIiXejnRT9QRSiSLLTUEsEUK EafxxDY91tT7gSr+aNl4uZbcN7Hom2oChYeUxZSvuH6HictZqNvLJ4uDiv74vzFxDPrS umED5bDi5bbMDVq0gS8cODM1cBQpab1VGEm4h1pNuZ7Dp53KLyjuTEsHcRHEuv9zBEzH b9WtjT1kB5FKbqWk/eCBNvhlgX9bflhBwSgp3vyCmEAcNdtfuR9jdWLVVF22yoBwkMUv IKmw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="pGw8Lg/x"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id x1si4836228qva.159.2020.02.25.04.50.30 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 25 Feb 2020 04:50:30 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="pGw8Lg/x"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:54794 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j6ZfR-0002Vq-Ql for patch@linaro.org; Tue, 25 Feb 2020 07:50:29 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:59293) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j6ZcZ-0005fR-Qv for qemu-devel@nongnu.org; Tue, 25 Feb 2020 07:47:33 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j6ZcY-0007IE-Lr for qemu-devel@nongnu.org; Tue, 25 Feb 2020 07:47:31 -0500 Received: from mail-wr1-x444.google.com ([2a00:1450:4864:20::444]:35448) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1j6ZcY-0007Ho-F2 for qemu-devel@nongnu.org; Tue, 25 Feb 2020 07:47:30 -0500 Received: by mail-wr1-x444.google.com with SMTP id w12so14596305wrt.2 for ; Tue, 25 Feb 2020 04:47:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=PR3MIDvz3PtDDaollGFXmkX1Ue3lMr6ulNQeQQNdSxU=; b=pGw8Lg/xVnYtr0lrehL9FkVN/2n4/Ho6Ly0xoHVrpuo6Ee8DMdaUtWxc46FTb6iSGE akC3scEjRjW0s0Kezy746JiTmHNAftymMKbX3FUmkCPP867woLwwyF29iksFsB/n5Ygs gAlw/Fbvbx99QUzjRbBpY/3/3EIhpSjLKLEUTtiy2kbPtvVlt52YyCD9rvu4TOiuNF5k 1UG2cbC/xJrGSM9lkuT23xERBK8A8haCSSRLohDJNmLOiAhaxzSoPAXTqS8lJKkDNe9M yggpwwqoTR6MqoNYq+cFLwq6p3XeHE0PL2DUGrN269B1KdC1MFXO2go1rZcyjiRdI3FA qDLg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=PR3MIDvz3PtDDaollGFXmkX1Ue3lMr6ulNQeQQNdSxU=; b=oQ8ZUcmudiXn7HExImOUYFpv1OQQw54QXI/vafxUPfknFAlfEoPH/8JmF4ecbv4NW5 jfjtCw0uAkKr26QrA1rTsKfv5jG/br5fNe2iHgudIUISb14wDbYzUTiTjVaUSQ5rSal8 z41C43B4eZWhprjKH+iuxLGHOwFOSCCBZWwOmVxgPVPj1J7BRM7VRWD+dFfju2P/EWpt YRsCRmAx9Q8NsRCmc1/vM58b0imMZpPgpiadnT7RAoJIhVce4d46JaLX7eLmMFjYZngk oiuDf/JAwCVaEdjtLuA71iCv4jU4oFJ/4kxiJcAIAzxiUU8bgh+iDYc38Cl+D3rUqBwf vINQ== X-Gm-Message-State: APjAAAVLuOvgnI0zv/2mQOv/++nSdNZn5H2QTIcAVsNo5XPWm/q54Oqa GY/3OKSojfHHbA2mbrjYobZsEjVnQdU= X-Received: by 2002:adf:ee86:: with SMTP id b6mr13478800wro.282.1582634849473; Tue, 25 Feb 2020 04:47:29 -0800 (PST) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id b10sm23808377wrt.90.2020.02.25.04.47.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Feb 2020 04:47:22 -0800 (PST) Received: from zen.home.arpa (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 59D041FF9C; Tue, 25 Feb 2020 12:47:11 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v3 12/19] tests/plugin: prevent uninitialized warning Date: Tue, 25 Feb 2020 12:47:03 +0000 Message-Id: <20200225124710.14152-13-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200225124710.14152-1-alex.bennee@linaro.org> References: <20200225124710.14152-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::444 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: fam@euphon.net, Thomas Huth , berrange@redhat.com, robert.foley@linaro.org, pbonzini@redhat.com, stefanb@linux.vnet.ibm.com, =?utf-8?q?Alex_Benn=C3=A9e?= , Euler Robot , richard.henderson@linaro.org, f4bug@amsat.org, robhenry@microsoft.com, marcandre.lureau@redhat.com, aaron@os.amperecomputing.com, cota@braap.org, stefanha@redhat.com, kuhn.chenqun@huawei.com, peter.puhov@linaro.org, aurelien@aurel32.net Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Chen Qun According to the glibc function requirements, we need initialise the variable. Otherwise there will be compilation warnings: glib-autocleanups.h:28:3: warning: ‘out’ may be used uninitialized in this function [-Wmaybe-uninitialized] g_free (*pp); ^~~~~~~~~~~~ Reported-by: Euler Robot Signed-off-by: Chen Qun Reviewed-by: Thomas Huth Message-Id: <20200206093238.203984-1-kuhn.chenqun@huawei.com> [AJB: uses Thomas's single line allocation] Signed-off-by: Alex Bennée Reviewed-by: Richard Henderson --- tests/plugin/bb.c | 6 +++--- tests/plugin/insn.c | 3 +-- 2 files changed, 4 insertions(+), 5 deletions(-) -- 2.20.1 diff --git a/tests/plugin/bb.c b/tests/plugin/bb.c index f30bea08dcc..df19fd359df 100644 --- a/tests/plugin/bb.c +++ b/tests/plugin/bb.c @@ -22,9 +22,9 @@ static bool do_inline; static void plugin_exit(qemu_plugin_id_t id, void *p) { - g_autofree gchar *out; - out = g_strdup_printf("bb's: %" PRIu64", insns: %" PRIu64 "\n", - bb_count, insn_count); + g_autofree gchar *out = g_strdup_printf( + "bb's: %" PRIu64", insns: %" PRIu64 "\n", + bb_count, insn_count); qemu_plugin_outs(out); } diff --git a/tests/plugin/insn.c b/tests/plugin/insn.c index 0a8f5a0000e..a9a6e412373 100644 --- a/tests/plugin/insn.c +++ b/tests/plugin/insn.c @@ -44,8 +44,7 @@ static void vcpu_tb_trans(qemu_plugin_id_t id, struct qemu_plugin_tb *tb) static void plugin_exit(qemu_plugin_id_t id, void *p) { - g_autofree gchar *out; - out = g_strdup_printf("insns: %" PRIu64 "\n", insn_count); + g_autofree gchar *out = g_strdup_printf("insns: %" PRIu64 "\n", insn_count); qemu_plugin_outs(out); }