From patchwork Tue Apr 12 13:55:19 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Olaf Hering X-Patchwork-Id: 8810681 Return-Path: X-Original-To: patchwork-xen-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id A60E1C0553 for ; Tue, 12 Apr 2016 13:57:45 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id CC2BE20108 for ; Tue, 12 Apr 2016 13:57:44 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D468F2035E for ; Tue, 12 Apr 2016 13:57:42 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1apymw-0001Oe-9B; Tue, 12 Apr 2016 13:55:30 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1apymu-0001OX-7G for xen-devel@lists.xen.org; Tue, 12 Apr 2016 13:55:28 +0000 Received: from [85.158.139.211] by server-11.bemta-5.messagelabs.com id 86/6F-27787-F4EFC075; Tue, 12 Apr 2016 13:55:27 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrKLMWRWlGSWpSXmKPExsUSuHLSIl2/fzz hBitXGFss+biYxYHR4+ju30wBjFGsmXlJ+RUJrBk9uy+wFVzmq/jwfy9bA+Ncni5GLg4WgcdM EnubnrJ1MXJySAj4SqzrmMbYxcgBZItIPPmfBlIjJHCKUeLor6/sIDVsAkoSew8eZwSxRQSkJ a59vgxmMwtkSexefADMFhYwlrg37zYziM0ioCrx+s5+VhCbV8BO4uXy5SwQu+QkLk9/wDaBkX sBI8MqRvXi1KKy1CJdC72kosz0jJLcxMwcXUMDU73c1OLixPTUnMSkYr3k/NxNjEDvMgDBDsa Dzc6HGCU5mJREeQ++5wkX4kvKT6nMSCzOiC8qzUktPsQow8GhJMH76Q9QTrAoNT21Ii0zBxhm MGkJDh4lEd7bIGne4oLE3OLMdIjUKUZFKXHeDpCEAEgiozQPrg0W2pcYZaWEeRmBDhHiKUgty s0sQZV/xSjOwagkzHsGZApPZl4J3PRXQIuZgBY/+8cJsrgkESEl1cC4z/b6Qs6CPGf2ZxPu35 Nz4+I13hO09VHf7fMrkp6+vcIu9MmvKa5t0pP3KSXq92Qe6LDcv3P4dPLPg4fLg7LyovlWVQV G3eIT23rn8L02e8dWLYdTX1N1nv+Olt1/PDHoZknEouXpxfqs178vKvYVKV82t+vqNK4TelNE Ux/7XZkXIiEpWyKmxFKckWioxVxUnAgAB/PaB2gCAAA= X-Env-Sender: olaf@aepfle.de X-Msg-Ref: server-3.tower-206.messagelabs.com!1460469326!34341543!1 X-Originating-IP: [81.169.146.162] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: QmFkIElQOiA4MS4xNjkuMTQ2LjE2MiA9PiA1ODg3NDY=\n,sa_preprocessor: QmFkIElQOiA4MS4xNjkuMTQ2LjE2MiA9PiA1ODg3NDY=\n X-StarScan-Received: X-StarScan-Version: 8.28; banners=-,-,- X-VirusChecked: Checked Received: (qmail 33167 invoked from network); 12 Apr 2016 13:55:26 -0000 Received: from mo4-p00-ob.smtp.rzone.de (HELO mo4-p00-ob.smtp.rzone.de) (81.169.146.162) by server-3.tower-206.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 12 Apr 2016 13:55:26 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1460469326; l=1863; s=domk; d=aepfle.de; h=Date:Subject:Cc:To:From; bh=bI4zXDF+KfAQu9WxzgQ8FXCJQFPLdGSZmx4EJpadNO4=; b=p1XBjjWvtsWBdM2MOpVEEYhXFDhFBN+5W3aMrRNSixi4fWUmrMF03CZ2o/13pvEpShA I4JxHpde7uSkaGA/nOdV+rOhl+6Z8aL6Au89P9ShNr1Z84SVBzqGs6RsHs1hCafNKjyyU 8NP2AwvjAaZ5TYHx8NmM2zHQ/HNWYoWB0eU= X-RZG-AUTH: :P2EQZWCpfu+qG7CngxMFH1J+yackYocTD1iAi8x+OWtqWFmrC5F/k8z92bDrkQ== X-RZG-CLASS-ID: mo00 Received: from aepfle.de (aftr-185-17-206-120.dynamic.mnet-online.de [185.17.206.120]) by post.strato.de (RZmta 37.22 DYNA|AUTH) with ESMTPA id J07e78s3CDtMR5y; Tue, 12 Apr 2016 15:55:22 +0200 (CEST) From: Olaf Hering To: xen-devel@lists.xen.org Date: Tue, 12 Apr 2016 15:55:19 +0200 Message-Id: <1460469319-12877-1-git-send-email-olaf@aepfle.de> X-Mailer: git-send-email 2.8.1 Cc: Wei Liu , Olaf Hering , Ian Jackson Subject: [Xen-devel] [PATCH] tools: fix compile errors with -Og X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP At least gcc-4.8 and older fails to recognize that err is always initialized, the build fails: xc_cpupool.c: In function 'xc_cpupool_removecpu': xc_cpupool.c:168:5: error: 'err' may be used uninitialized in this function [-Werror=maybe-uninitialized] return err; Fix this in blktap2 and libxc. Signed-off-by: Olaf Hering Cc: Ian Jackson Cc: Wei Liu Reviewed-by: Dario Faggioli Acked-by: Wei Liu --- tools/blktap2/drivers/tapdisk-vbd.c | 6 +++--- tools/libxc/xc_cpupool.c | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/blktap2/drivers/tapdisk-vbd.c b/tools/blktap2/drivers/tapdisk-vbd.c index 89ef9ed..31bc2fe 100644 --- a/tools/blktap2/drivers/tapdisk-vbd.c +++ b/tools/blktap2/drivers/tapdisk-vbd.c @@ -516,7 +516,7 @@ tapdisk_vbd_free_stack(td_vbd_t *vbd) int tapdisk_vbd_open_stack(td_vbd_t *vbd, uint16_t storage, td_flag_t flags) { - int i, err; + int i, err = 0; vbd->flags = flags; vbd->storage = storage; @@ -932,7 +932,7 @@ tapdisk_vbd_open_image(td_vbd_t *vbd, td_image_t *image) static int tapdisk_vbd_close_and_reopen_image(td_vbd_t *vbd, td_image_t *image) { - int i, err; + int i, err = 0; td_close(image); @@ -972,7 +972,7 @@ tapdisk_vbd_pause(td_vbd_t *vbd) int tapdisk_vbd_resume(td_vbd_t *vbd, const char *path, uint16_t drivertype) { - int i, err; + int i, err = 0; if (!td_flag_test(vbd->state, TD_VBD_PAUSED)) { EPRINTF("resume request for unpaused vbd %s\n", vbd->name); diff --git a/tools/libxc/xc_cpupool.c b/tools/libxc/xc_cpupool.c index 261b9c9..abf707d 100644 --- a/tools/libxc/xc_cpupool.c +++ b/tools/libxc/xc_cpupool.c @@ -151,7 +151,7 @@ int xc_cpupool_removecpu(xc_interface *xch, int cpu) { unsigned retries; - int err; + int err = 0; DECLARE_SYSCTL; sysctl.cmd = XEN_SYSCTL_cpupool_op;