From patchwork Fri Feb 7 15:01:16 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: 183201 Delivered-To: patch@linaro.org Received: by 2002:a92:1f12:0:0:0:0:0 with SMTP id i18csp848782ile; Fri, 7 Feb 2020 07:10:30 -0800 (PST) X-Google-Smtp-Source: APXvYqwtbCNUOQwAco6LZQbIYzSvS/1cyKNnZw1cqZ4uCsnXv/kQz5b6Wc69M9nkKhhyINKd6GJW X-Received: by 2002:ac8:5358:: with SMTP id d24mr7627196qto.161.1581088230271; Fri, 07 Feb 2020 07:10:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581088230; cv=none; d=google.com; s=arc-20160816; b=IfmmfSYsfWN9mGuUHMcKwC5GkXeGISta1VFL1k/MJAciFulRk3E3lSBlBR1bW70XCC yJPgCg+Iez4RuIoiTsEVyX9wKUyKXdJLd8PbL1PTElHYf4z/P/KkAyR/5vgWA/EcHsWl aXJ2ne7AiGhZ93OaV9vKqzzKJvdwEmu9dqX7Ddyk7i6nt9TxmY5opMwNgA7D8xX1UVny zeInsD0xREPkS26pnENAAeJdcJfsIEKLjLmxO/NivjOj6MtEPa0oboCu0qIO57LDDdEW HnHLGXt8AOfAqLoxrxoBaG9jwyk+O1UYcJKJ0CN5OVFTYVzOPVblTvd5kmuoUNF7+kpP U52g== 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=NuT51ChIEQ4Kna0auqW3OS2c6axOB9q/YF3f1QpycFw=; b=S3jXtesqp6Fq4wVry85uDlUR5fN5M8Ycz6QiXhJ7aeyHj3O4K9LqB0rGDszKpLDR0B q1DTLEre4Ru/g1uy9GbAdqVd7WENXw7xqj91ydjRLYlaPLoVZdnpgIP+k0sfOTZ1VuTW lIAbfbDhNvxMFgjFfSkVowKJAGolTq3QtqJpqcJvvWFOMD+HVWv1GhJ1cA2+Y4Ol/mEF C/tdkDgSyOpSTgSoaz5xEPtf5DayPfl67OkiCND4vcrV0WI6bpGvCYKLg9O6m3csKI37 LxnWppzEnJhfZmb/NHGzWDXSMZ6xCRRCHNAvrTKoRsBx7GHXjFgAHkCI3yVPcgSLqj5Z CUOw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=WboE51Sf; 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 n88si1327902qva.73.2020.02.07.07.10.30 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 07 Feb 2020 07:10: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=WboE51Sf; 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]:59032 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j05H3-0000GF-PP for patch@linaro.org; Fri, 07 Feb 2020 10:10:29 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:60286) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j058I-0000rP-Ai for qemu-devel@nongnu.org; Fri, 07 Feb 2020 10:01:27 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j058H-0003yi-4G for qemu-devel@nongnu.org; Fri, 07 Feb 2020 10:01:26 -0500 Received: from mail-wr1-x442.google.com ([2a00:1450:4864:20::442]:38148) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1j058G-0003us-T9 for qemu-devel@nongnu.org; Fri, 07 Feb 2020 10:01:25 -0500 Received: by mail-wr1-x442.google.com with SMTP id y17so3064128wrh.5 for ; Fri, 07 Feb 2020 07:01:24 -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=NuT51ChIEQ4Kna0auqW3OS2c6axOB9q/YF3f1QpycFw=; b=WboE51SfCbCsN9Z4ZbYGqNSOhCeN32zDKYJ4nQEYHWwgsyeaIWcoZ0BpqncKpZy1Td XfE5NPZR9lszSRZ2gtpv8q2lzbV8bVDHKLunBSSaVpJyjl/AS4xBSZotrNNgLAHJ/Z9P qWQjilgeTpkXuswEN4LP348xFDlFPcr25CzLSARth60+x/CaHnf/DRYfuy2XpfVSgAXP CG4SJnxmw2M0wZs0SuH2bPDhOknMArsFL7baSMOQS4tWzdHye51y0vm0zu76DHiG0B3x 9mfHKAF9nkInFyD0DoXtfbsuELFBaweHc7rRC12H3mdT8Bs6H741h/ZQA9AVkijpREUl 7ZGw== 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=NuT51ChIEQ4Kna0auqW3OS2c6axOB9q/YF3f1QpycFw=; b=E2fASua470+wEUVWBd7VwUgc4R0Vv/MwiavhWnC10VU0Fki74h1G6omH/lQaAAa7Sp 5Vl0d0qy7u0u/ScfT7vxd1pZgb0333RYBa74hBTx3jvkBYikO84xJxYdVCdfovcnsOhK WKOs3IMDbsAnaWwoDrR7xxGmcavifz1FBeXX7YFqDw2kSnwo9SL51BMoXYW4ADeslfEI MAhzDhCp4vBhOtyKTEGnTCFBXNB2RgxHaDZAWTukc09tRdwkrjvda3MQajMNrUUQPeam sz6P14xNBVa+WI3rwDn+7QSgvf+nvswCPSnrTAfH0GKfd+cvcC1Siuep3mG8WucRP1Rn jkPw== X-Gm-Message-State: APjAAAXOC7WRB3yqdG03qLv0cztkb6j4wouBvtLZ5mf2RTL2pNkVWg7A 6LyujzG3gebUrkB0ApI14YHN/9rwgvc= X-Received: by 2002:adf:b193:: with SMTP id q19mr5099864wra.78.1581087683942; Fri, 07 Feb 2020 07:01:23 -0800 (PST) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id b10sm3706967wrt.90.2020.02.07.07.01.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Feb 2020 07:01:20 -0800 (PST) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 2F7EA1FF90; Fri, 7 Feb 2020 15:01:19 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v1 3/5] tests/plugin: prevent uninitialized warning Date: Fri, 7 Feb 2020 15:01:16 +0000 Message-Id: <20200207150118.23007-4-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200207150118.23007-1-alex.bennee@linaro.org> References: <20200207150118.23007-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::442 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: Thomas Huth , robert.foley@linaro.org, Euler Robot , robhenry@microsoft.com, aaron@os.amperecomputing.com, cota@braap.org, kuhn.chenqun@huawei.com, peter.puhov@linaro.org, =?utf-8?q?Alex_Benn=C3=A9e?= 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 --- tests/plugin/bb.c | 6 +++--- tests/plugin/insn.c | 3 +-- 2 files changed, 4 insertions(+), 5 deletions(-) -- 2.20.1 Reviewed-by: Richard Henderson 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); }