From patchwork Mon Apr 25 15:35:28 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 102462 Delivered-To: patch@linaro.org Received: by 10.140.93.198 with SMTP id d64csp1106943qge; Mon, 25 Apr 2016 08:38:13 -0700 (PDT) X-Received: by 10.66.66.167 with SMTP id g7mr48936677pat.111.1461598680703; Mon, 25 Apr 2016 08:38:00 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k74si7298392pfb.30.2016.04.25.08.38.00; Mon, 25 Apr 2016 08:38:00 -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 S932949AbcDYPh5 (ORCPT + 29 others); Mon, 25 Apr 2016 11:37:57 -0400 Received: from mout.kundenserver.de ([212.227.17.24]:50018 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932868AbcDYPhQ (ORCPT ); Mon, 25 Apr 2016 11:37:16 -0400 Received: from wuerfel.lan. ([78.42.132.4]) by mrelayeu.kundenserver.de (mreue101) with ESMTPA (Nemesis) id 0Mbyf0-1bAk1q0FKo-00JL1s; Mon, 25 Apr 2016 17:35:40 +0200 From: Arnd Bergmann To: Michal Marek Cc: linux-kbuild@vger.kernel.org, Peter Oberparleiter , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Arnd Bergmann Subject: [PATCH 2/5] Kbuild: disable 'maybe-uninitialized' warning for CONFIG_PROFILE_ALL_BRANCHES Date: Mon, 25 Apr 2016 17:35:28 +0200 Message-Id: <1461598531-2190169-3-git-send-email-arnd@arndb.de> X-Mailer: git-send-email 2.7.0 In-Reply-To: <1461598531-2190169-1-git-send-email-arnd@arndb.de> References: <1461598531-2190169-1-git-send-email-arnd@arndb.de> X-Provags-ID: V03:K0:AKdE+Y2u2sDRGlzgA5/HLAmNJmZmNoQnhX1E0Szv9kUmIasu6La s3imiEbNLPL8N5nfZZPdqCfY9BZtnn18Wv9vzmPsTDqOf6A1l9CgmXdLmPK9tVx2QSHfH5y 5LQw6ue/5Ke+mU2Mb5IshwhlNmZx2x57gY5R5zpwnugDTerCmlUvmARpQXJvZQLmxbNUoP8 Y3IPlzb/jnf9xBdpE7K7w== X-UI-Out-Filterresults: notjunk:1; V01:K0:4G9qpzEPeSg=:O9ht2jTMnHFBDQ2+AT52e4 H/80E2G6A5ZtU2ehPPELxCdQp9DkCFldW2wf5FVME6s6t2Dl2wA1M4UzXBf3F+TFdcyKQQG0s tT09kM4Bxe3nVM57GlZOcHNB81NhbKe72KwbZB25TvXm8B+OKZlKAYnPP4Vk+QWUVgIk8++6C 1Xj40RwL9PNDdVezeol7wnZ5iy29AxNxEV8dDTdgWlkU0kfw1o3WyX2oT4kQ+q6Q5KsaYJntx 2DAr9mWtztK1R74+rL4ihyexJm2YssSY3HRRYfKcc3jT0qR/ilBXI1XfjdrdA4LHWqCHZnggf ZqY+q5yUctDKI6gspMtgnq8fz53xYswv0yqksrGCG5ySi25mmYOwKdkBx8BrZJGmfTTwaeVg2 1RMrgwgnGHoMY6O620VBjoNHytRDbT29tctBCfWx6557739W/5JrretK2mCM2EW/jY+xBlh2l 9JmZvag5sEfIZxyyvdAKSVPfNgPx2DPyXijXiqXVuZyf5oQfCF5aZv4zklM8UZI8v0GVURsco JyUjkQU5+lzX3wSCUQlIy/NNlS7vda6fejdN0hCiJWkhqdC2/RC9Oktayv6eTn3LaiFrV/1PY ry5wwO38SKCWmMFJMFa6ZR+o4IAt5+y02F5MdIwHmNrnyeOQ5xcBQA6h1x9EAP84UJBnNxSkf 5mNDY247FVNJVrteZmyenIsB77wK1A6+njHQgqoZFSorw2FApLH4H4roLYxYvlzGLt3Y= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org CONFIG_PROFILE_ALL_BRANCHES confuses gcc-5.x to the degree that it prints incorrect warnings about a lot of variables that it thinks can be used uninitialized, e.g.: i2c/busses/i2c-diolan-u2c.c: In function 'diolan_usb_xfer': i2c/busses/i2c-diolan-u2c.c:391:16: warning: 'byte' may be used uninitialized in this function iio/gyro/itg3200_core.c: In function 'itg3200_probe': iio/gyro/itg3200_core.c:213:6: warning: 'val' may be used uninitialized in this function leds/leds-lp55xx-common.c: In function 'lp55xx_update_bits': leds/leds-lp55xx-common.c:350:6: warning: 'tmp' may be used uninitialized in this function misc/bmp085.c: In function 'show_pressure': misc/bmp085.c:363:10: warning: 'pressure' may be used uninitialized in this function power/ds2782_battery.c: In function 'ds2786_get_capacity': power/ds2782_battery.c:214:17: warning: 'raw' may be used uninitialized in this function These are all false positives that either rob someone's time when trying to figure out whether they are real, or they get people to send wrong patches to shut up the warnings. Nobody normally wants to run a CONFIG_PROFILE_ALL_BRANCHES kernel in production, so disabling the whole class of warnings for this configuration has no serious downsides either. Signed-off-by: Arnd Bergmann Acked-by: Steven Rostedt --- Makefile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) -- 2.7.0 diff --git a/Makefile b/Makefile index c5a3db5aebd1..e595d1f626b8 100644 --- a/Makefile +++ b/Makefile @@ -624,7 +624,11 @@ KBUILD_CFLAGS += $(call cc-option,-fno-delete-null-pointer-checks,) ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE KBUILD_CFLAGS += -Os $(call cc-disable-warning,maybe-uninitialized,) else -KBUILD_CFLAGS += -O2 +ifdef CONFIG_PROFILE_ALL_BRANCHES +KBUILD_CFLAGS += -O2 $(call cc-disable-warning,maybe-uninitialized,) +else +KBUILD_CFLAGS += -O2 +endif endif # Tell gcc to never replace conditional load with a non-conditional one