From patchwork Thu Feb 13 22:51:02 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: 183446 Delivered-To: patch@linaro.org Received: by 2002:a92:1f12:0:0:0:0:0 with SMTP id i18csp1088205ile; Thu, 13 Feb 2020 15:03:59 -0800 (PST) X-Google-Smtp-Source: APXvYqzqHK9c+v3ZvhsLtKG0GH7VmWARpmunQIVklMvJ8ZBlEo6YnoP1YX+cA0VehIC6RkZGDqh9 X-Received: by 2002:a05:6214:524:: with SMTP id x4mr26221945qvw.4.1581635038561; Thu, 13 Feb 2020 15:03:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581635038; cv=none; d=google.com; s=arc-20160816; b=CjkKRdfBfQDx0L4NgQZ2pzGtbFl5LJWtmG2j9t3pwC5Epu+Q7xN2PM2Wew/uvFTrM9 ROLtZ9U0xELhYdQh3vyksLDnokIthL+xuzQGgLDfpki8NUVRtNGKjq24p/GDThyFNmFD jOMZJ8LafuCM3eejPre67fzbAEsySn1YFY7haPewDDYnTuvUs5IMDFrydI9gxKBq6pFF LGMa1TSHuAZJ7vYDvHJYqczUGz58Cz/juS0BfcNOwTxVpvJ6x3FYdi3eHmW9KQ0R6VyZ YadIjFMkbu9eOxlNX2iqtmgba3TC+YsBV5THRGMpSnCv5zhZFUh8f/X9ArywiYFVxkLL wkBg== 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=k7MDQuLRzMurUIG+ber+EiFJNWF29XSAcRllxHd7xVjcgHb1yGe4CgsrWgdgfeYs30 uvuZ8dIQzZRM/DqiksGfpkXWYbFctc+19RhoHhsYKxHCK+G3NmU6hdf5ZnHxiTMZqriV CyCy7soaDhBHXJyOGYlxyBaWfKqJ3an0w/nykmvIRZleGX699bCqecQ6wYBU4gMPBxG8 +Tjh8d44fnfWMpuUm5KJPChXW/VRPlSSWIRLFjKGKv3SCaVGrNWvhwD1naV7tRqsbpnh 0JA6tiX7kGNZhgVWJzPT23jSzbyDa6XcHmmvBuhKNUGfSt0gcTkhIdfuyUP7vNt7xukP d4Nw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=HGy8wIBT; 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 g21si1948137qki.127.2020.02.13.15.03.58 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 13 Feb 2020 15:03:58 -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=HGy8wIBT; 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]:60640 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j2NWY-0007Ic-49 for patch@linaro.org; Thu, 13 Feb 2020 18:03:58 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40059) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j2NKT-00052q-9j for qemu-devel@nongnu.org; Thu, 13 Feb 2020 17:51:30 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j2NKR-00042G-8o for qemu-devel@nongnu.org; Thu, 13 Feb 2020 17:51:28 -0500 Received: from mail-wm1-x341.google.com ([2a00:1450:4864:20::341]:55728) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1j2NKQ-0003zK-W2 for qemu-devel@nongnu.org; Thu, 13 Feb 2020 17:51:27 -0500 Received: by mail-wm1-x341.google.com with SMTP id q9so8049030wmj.5 for ; Thu, 13 Feb 2020 14:51:26 -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=HGy8wIBTjh4t+t0UcTdaF4nKqSFidG8Nzy8TP43VSwJ7xA3QuJwKqzhfg0tOlb+td1 RhzwZ+hVAHoz7hV2mntzn4VR5vk6q7NLN72XjpUbrmx1sEkQ5Hx8NhHc/VaL5fmMI76i FZMlLlSSdCeM4WTi26riXAe5p7rYxa+Gx4LLFOO9XJv+3bCnXbNbwakjLDpoMilcTSkM 0cxA3f3QnQFq/l8QJmaxls/yeHRS0miiJpLDfzU2PHdDawb8K27y+16taT0X2w8I6wbT XWMLXBFXI6GEiAHDNiJrak3o84kR7ZRhTUR2PsnKfFsB/b+FT6KW2W3AnKOq6baH1DjD mmYQ== 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=tK6uE3UhUbF9W2FALvPHoa2RXxQ+fRe/uYzYFgJ4JnuPD0uXCBKdVC1ju2McSBdBdB EhBrzwz0SvZk2IzIU7AaNlIOCRJp0hjzllynDah7Gx/N8G48oD3J4LYSPkOoZ7M+1Z07 o/y5uHEnO8Lc3e/Be9u/+DVlVC1vbXejcDdOeFq5rZk8ISpwsvi0PKb/WIpRKgrb2IIg 4HNZ1N8YayFSovLpLqold34oGvRm4n07ArajkTz7RPqvQSdrp7hsbycJtsSWqqUoNHkB WAkIn0VWp/PcZBHVg3eCU2CJLxvpyDTYNfQo32KByWEZPqgpE2NCsS8Wmb/l/5Uui0L9 u2bA== X-Gm-Message-State: APjAAAWgj05n401qn5YURZMXI5UZalw69gKAFgNBRI0Ki6TVurRMnPjm w8zIkmcMoM4lTO79qqUtkCEj1Q== X-Received: by 2002:a1c:df09:: with SMTP id w9mr276099wmg.143.1581634285619; Thu, 13 Feb 2020 14:51:25 -0800 (PST) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id w15sm4698048wrs.80.2020.02.13.14.51.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Feb 2020 14:51:20 -0800 (PST) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id AAAE51FF9C; Thu, 13 Feb 2020 22:51:10 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v2 12/19] tests/plugin: prevent uninitialized warning Date: Thu, 13 Feb 2020 22:51:02 +0000 Message-Id: <20200213225109.13120-13-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200213225109.13120-1-alex.bennee@linaro.org> References: <20200213225109.13120-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::341 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); }