Message ID | 20170719125310.2487451-2-arnd@arndb.de |
---|---|
State | New |
Headers | show
Delivered-To: patch@linaro.org Received: by 10.140.101.44 with SMTP id t41csp780176qge; Wed, 19 Jul 2017 05:55:34 -0700 (PDT) X-Received: by 10.98.160.131 with SMTP id p3mr2821658pfl.236.1500468934681; Wed, 19 Jul 2017 05:55:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1500468934; cv=none; d=google.com; s=arc-20160816; b=R1mn2uQwNx2jSfjz9/1OCRYvsfq5SRmgW+q9XqnqXRb1o9NP5tWQCFPKKYenJndCss 8QCvg8pEmphwtx0IrW5Cy1z6BbB1KVwP+97AqlxSbNswIVfDaFRRVBXqSLzUoJWtaCJH JBZN1l2KynzpiSyGMM/a5ARHNfFCCqHYO6nhrkDWoNu/mOWkV9AqxpLa+Y/kOyycTlNY ciUtse0KvEsLve7W+nQMMPSY5FuZTMMw+E7A6JGUUPA0Q4sgmvEdGJItUuJkHAUZJcip z7MoBvFTqTa7mM/CHSw22cSFI3TtvxVspGCF8gm5cjDtQ6mHzR/i/0Z+n7ybcC/lwy1S NV4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=IXsy0a+7fhRTiM0tWpmMWokFzU2Wzh4gRPU+/S54y9Q=; b=wT8Z54FKq/p4CQ1sNuI9/oyvoQ419A7IWoZVBgRAFxY4z/ihdNj7iXIl/KPFr0sl8A yo52MMhpncebwjqUyButQ0NmimWwvgG37BIcBeaKJ6BZOANGct+UHPXCf7N1hW7lcpuJ 6doDaTsbK3nQrI2CWjcCEseyckLmhz8hUOArVqZa9PD77xmya4fDpE3ST4jgC85gB8e+ gYErrogZkK5MaEBkqOLuxiwOz8kJQNAnCJa+U0Aof8HUq2SwUjLHuDCe34g7FpU8BOxC NjrH5aEPali3cCJbfuE/0kPc0Oy3DXqTrOZRoaaj4ea/wwQeojzSoCBpi1ZaX/96hWt2 Ju/Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: <linux-kernel-owner@vger.kernel.org> Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t136si205268pgc.742.2017.07.19.05.55.34; Wed, 19 Jul 2017 05:55:34 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753804AbdGSMzb (ORCPT <rfc822;georgi.djakov@linaro.org> + 25 others); Wed, 19 Jul 2017 08:55:31 -0400 Received: from mout.kundenserver.de ([217.72.192.73]:49821 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753740AbdGSMz1 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 19 Jul 2017 08:55:27 -0400 Received: from wuerfel.lan ([5.56.224.194]) by mrelayeu.kundenserver.de (mreue102 [212.227.15.145]) with ESMTPA (Nemesis) id 0MPGtM-1dcCCM0tsW-004PwK; Wed, 19 Jul 2017 14:53:50 +0200 From: Arnd Bergmann <arnd@arndb.de> To: x86@kernel.org, Peter Zijlstra <peterz@infradead.org>, Ingo Molnar <mingo@redhat.com>, Arnaldo Carvalho de Melo <acme@kernel.org>, Thomas Gleixner <tglx@linutronix.de>, "H. Peter Anvin" <hpa@zytor.com> Cc: linux-kernel@vger.kernel.org, Arnd Bergmann <arnd@arndb.de>, Alexander Shishkin <alexander.shishkin@linux.intel.com>, Andy Lutomirski <luto@kernel.org>, Josh Poimboeuf <jpoimboe@redhat.com> Subject: [PATCH 1/8] perf/x86: shut up false-positive -Wmaybe-uninitialized warning Date: Wed, 19 Jul 2017 14:52:59 +0200 Message-Id: <20170719125310.2487451-2-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20170719125310.2487451-1-arnd@arndb.de> References: <20170719125310.2487451-1-arnd@arndb.de> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Provags-ID: V03:K0:tBqGbSNp/372vv3mDfo1YevP9LtlvuALFs+8E+BPdaAACB4+4Q6 CC9KogGKYQfmqdhn04KHax7o4P8IgaODwR+BqIlk4J4BuIM66H23tWaWBhrvSy7oSdZ9WD5 FIzkYNP5INkubjTz6xgWj2ZSxHnQMvvcdb8YJjM8OU/XY3jj4g41D4C+GGAvscoEu7A7LBi bDQeD0htygVNq/2nrtiyw== X-UI-Out-Filterresults: notjunk:1; V01:K0:FVR0qPjccaQ=:0fzd48w59xbqXlhviAhL8+ eI+D4DJREO/knbylIhrC1cP87nqPT1RJm4Xl7E5SKAnBk84siLUeSrO7msFPfycI629rg07M5 v3a+c/s752x7kjVZ3UEqnLLrOfwG1H/QWiC7n+yfQJrPvrH1uL1j3vfOTHPzOvRzBuw0/QrxC egi8dsW8aB2mbqiSH/r3lx5rvjqJ/4reim+sTBCQmj7t+3GcC1Im3zYk1n7darEcZDBQOdzB+ Yp1Gn4So4LwjmBOQU9/SUlX0o98uxCV257AdEzZVvuzONQVe7SAxSozQ5nbarUA5azcScTCH2 ElyvUCls5s4xlOy558jhLrqqf6fh0rrBcImzoTomJY/q8vd1Ftm+ftTSzZIEdFAaDhJYdcUQk N/O+o8ownOp0L8DbeX6oSaDBk86nRTb4Gw0y7M8fa2fiAOqWkGpEE8wy8OrYu7quUaah8JzhU ce/aLR3cvMTpLreLpqhbdXGLq4YRFju1qucchIci0kSONcGDEapKXAtqlIszd12Elmu3TTDJV DNUgQ+yJfdWwKGUsB8lJ+e2ct1n9cqFLlyE2vK6QI9LlPjMt6+48q8Xb6jqKet0sJf9vO5D1k qTayzHdGRd7Dayqh7my2MypiaYrpCQqoQORHj3YpBCb8sZJ08LTDNmWusTQOV/00SE9eOS+Og TxL7/gFtiR5ofp2gOxopbR1z6cNn7VrLDdWaPuVJD6VAnOn4Pn2xciQSOWZNZfLZiCwLO8uPj D+hOFpUjxecCUARig+X9Whny7hMcmHpCsInOEmOori+XnPSJ2kdXmgC1Dd8= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org |
Series |
x86: randconfig warning fixes
|
expand
|
diff --git a/arch/x86/events/core.c b/arch/x86/events/core.c index ff1ea2fb9705..8e3db8f642a7 100644 --- a/arch/x86/events/core.c +++ b/arch/x86/events/core.c @@ -191,8 +191,8 @@ static void release_pmc_hardware(void) {} static bool check_hw_exists(void) { - u64 val, val_fail, val_new= ~0; - int i, reg, reg_fail, ret = 0; + u64 val, val_fail = -1, val_new= ~0; + int i, reg, reg_fail = -1, ret = 0; int bios_fail = 0; int reg_safe = -1;
The intialization function checks for various failure scenarios, but unfortunately the compiler gets a little confused about the possible combinations, leading to a false-positive build warning when -Wmaybe-uninitialized is set: arch/x86/events/core.c: In function ‘init_hw_perf_events’: arch/x86/events/core.c:264:3: warning: ‘reg_fail’ may be used uninitialized in this function [-Wmaybe-uninitialized] arch/x86/events/core.c:264:3: warning: ‘val_fail’ may be used uninitialized in this function [-Wmaybe-uninitialized] pr_err(FW_BUG "the BIOS has corrupted hw-PMU resources (MSR %x is %Lx)\n", We can't actually run into this case, so this shuts up the warning by initializing the variables to a known-invalid state. Link: https://patchwork.kernel.org/patch/9392595/ Suggested-by: Peter Zijlstra <peterz@infradead.org> Signed-off-by: Arnd Bergmann <arnd@arndb.de> --- v2: replaced original patch that reordered the code instead of adding a fake initialization. --- arch/x86/events/core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.9.0