From patchwork Wed Feb 26 07:39:22 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: 183898 Delivered-To: patch@linaro.org Received: by 2002:a92:1f12:0:0:0:0:0 with SMTP id i18csp2790918ile; Tue, 25 Feb 2020 23:45:06 -0800 (PST) X-Google-Smtp-Source: APXvYqysMFFEEmD5Sxeb5TG4phChMm9Hn/F9+LM2wpuVInw+58RHAMD3pZuCy8KMKhbiB7+jeElC X-Received: by 2002:a37:9fd0:: with SMTP id i199mr3900239qke.60.1582703106745; Tue, 25 Feb 2020 23:45:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582703106; cv=none; d=google.com; s=arc-20160816; b=X1r/hTY/bVN5PQUiAK6yZhWIU5LTGAkSMqf9gXWRLolpYlhjmczLKoNbqjzjNrf4BX pGXE6N6378FCSk7tNNwinX5o4C4CMjSd3nO8h+WZGZff4/ckQ+4czmrbO8ofBuZaUGqZ pd4VZGcnWffKg2m3rV+T4wb0pBLohjMDAQj6/s2t1O71cEoBn+WnMH6GLey00/7cIemV rYGznKTEPdOFCg1uBoBiUys0jKMHVMgWB+sW8FLkIwi25kY0kL/DI4HoGVkZSa+KMXni Edzu+8mb0NCzPxqCKHOhdIiJ20KHG6nwXwJZnoMReizJqtNJB4pe3nyiG/wjjzZPKyhA 346w== 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=iKkeoZq9HbTVeGuobEg9B8HnhSc+qC4HzgVEf5ivfAQ=; b=iaCwGmEd/t5RBcxv1SOMN1uhowmHXsotGG9fDMejGmxgPNoij8Q6WqLGYZAcdIx95r MimhoGprQfl1y6vkrrxZIXfGU15vR7tHpP4mZRWhvPuZcx1d8Ax15/awYWtmfuLix5QZ 9f54iHyXawUbPYeX6aLImCEgNrY3sGGyN4ce2jh4wzz7WzZyzvC0fK2JtVjE7o+HDdZ5 u2Jzvr4cLNYaLQZttVZHJXGQw7ZcxeZcYcJMPI/hmyrHnX2qdnsB8bTuu6SBXzbyiHDb Y8pwzht+7vj9NDeYn9uKq/6kW2DUmjjDhSTEnsDI4cG62Ljhgy/8gZ6SAEz+NywEJqis BHSQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=jWLD05JY; 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 f7si708914qtv.166.2020.02.25.23.45.06 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 25 Feb 2020 23:45:06 -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=jWLD05JY; 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]:39346 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j6rNS-0002GK-5V for patch@linaro.org; Wed, 26 Feb 2020 02:45:06 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:46260) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j6rIN-0000zV-9j for qemu-devel@nongnu.org; Wed, 26 Feb 2020 02:39:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j6rIM-0002u0-6B for qemu-devel@nongnu.org; Wed, 26 Feb 2020 02:39:51 -0500 Received: from mail-wm1-x342.google.com ([2a00:1450:4864:20::342]:39357) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1j6rIL-0002se-VW for qemu-devel@nongnu.org; Wed, 26 Feb 2020 02:39:50 -0500 Received: by mail-wm1-x342.google.com with SMTP id c84so1840644wme.4 for ; Tue, 25 Feb 2020 23:39:49 -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=iKkeoZq9HbTVeGuobEg9B8HnhSc+qC4HzgVEf5ivfAQ=; b=jWLD05JYdzjyIOMxlekctkdIfA094/bwKSVWPOv2lOrULpfDaIn3u7p6X4LCKOj/S+ 9uRGyoJ0mt6qbsbmpW9LgkRCeEqFOC0Hn3zy3RbcDkcIro3TdMnxkwX/ssZ0AJDiLUHg zU6BsWj0VOTPOdYEdEy4NR3aapGhNuZ4Wv5re2hrejJaAAOgYOEncH0EeP3SVFQJfDZi 4YFevoCSnlKtAwrm+mQt+14RcPIW7Auv4jDHWHqZzvss4riQrek6XfZfqufXaKR+ADuX mTM8dOwl+efsUqPbvOGwdHVkn5au4Svu143xTVkxu2zY0I3qt0M9DQnxZVP/XymCJ9cf vluA== 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=iKkeoZq9HbTVeGuobEg9B8HnhSc+qC4HzgVEf5ivfAQ=; b=CCAIjLun2259GEQaqkhU2mAQMJdaunrM+tuthW3M1nxG9rn8IY8UaLiOFMx6mbMFqi k8TFFNFxqmFM60ayEEo9oAzE22Ck4aDv+eNDI3/2WphEgBbxvBlTZfUF3VAdCjOrtKDO jJGthqVTLrDs08sMZ9gXrWTEYz2L3Gisi2lhrjGIlWCxGe9wPxSt2JUgOmKBjxx8hU5p tCOWnfb4b//SabgLCbNh3NcVEXHBinezWoxtfkkEJLfTCM1iqH8zlW6YdTPzXj1iqy7i ty1XVKD0CWb6iE+pCI/8lX9oat3wS5HIQrL9jHsMr+ZurE5LJk6udatsYcaScHJacRhB 6vJw== X-Gm-Message-State: APjAAAVJ/rw5YbbLHicWFqx6zaRZsefG007HfIjLPaAwRXWCCZO88KSx l+8XXTK9LcMxZz6F5pZqSFLIuQ== X-Received: by 2002:a1c:ddd6:: with SMTP id u205mr3946534wmg.151.1582702788871; Tue, 25 Feb 2020 23:39:48 -0800 (PST) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id h2sm2074201wrt.45.2020.02.25.23.39.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Feb 2020 23:39:41 -0800 (PST) Received: from zen.home.arpa (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 50A381FF9C; Wed, 26 Feb 2020 07:39:30 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL 12/19] tests/plugin: prevent uninitialized warning Date: Wed, 26 Feb 2020 07:39:22 +0000 Message-Id: <20200226073929.28237-13-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200226073929.28237-1-alex.bennee@linaro.org> References: <20200226073929.28237-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::342 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 , Richard Henderson , qemu-devel@nongnu.org, Euler Robot , Chen Qun , =?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 Reviewed-by: Richard Henderson Message-Id: <20200225124710.14152-13-alex.bennee@linaro.org> -- 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); }