From patchwork Fri Feb 12 16:06:19 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 102791 Delivered-To: patch@linaro.org Received: by 10.112.43.199 with SMTP id y7csp912592lbl; Fri, 12 Feb 2016 08:07:40 -0800 (PST) X-Received: by 10.66.141.11 with SMTP id rk11mr3232318pab.75.1455293259860; Fri, 12 Feb 2016 08:07:39 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id or6si20803441pab.5.2016.02.12.08.07.39; Fri, 12 Feb 2016 08:07:39 -0800 (PST) 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 S1751565AbcBLQHh (ORCPT + 30 others); Fri, 12 Feb 2016 11:07:37 -0500 Received: from mout.kundenserver.de ([212.227.126.134]:52765 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750917AbcBLQHe (ORCPT ); Fri, 12 Feb 2016 11:07:34 -0500 Received: from wuerfel.lan. ([78.42.132.4]) by mrelayeu.kundenserver.de (mreue001) with ESMTPA (Nemesis) id 0MbXng-1akpj2260y-00InAO; Fri, 12 Feb 2016 17:06:56 +0100 From: Arnd Bergmann To: Michal Marek Cc: linux-arm-kernel@lists.infradead.org, Peter Oberparleiter , linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, Arnd Bergmann Subject: [PATCH 2/5] Kbuild: disable 'maybe-uninitialized' warning for CONFIG_PROFILE_ALL_BRANCHES Date: Fri, 12 Feb 2016 17:06:19 +0100 Message-Id: <1455293187-179811-3-git-send-email-arnd@arndb.de> X-Mailer: git-send-email 2.7.0 In-Reply-To: <1455293187-179811-1-git-send-email-arnd@arndb.de> References: <1455293187-179811-1-git-send-email-arnd@arndb.de> X-Provags-ID: V03:K0:s1Oi12seCjumdw2BWNK2FQL9njEDf/8ViLnDXlRHuLlTmzpd5LN THvAx2u7W+oF8WBHcZWklVeLCUJ4uZHuDGu5AI45SUghOhxcHXLTm95ojbd1EX2P6FBxSy7 E9hWqfch4ugUGiaYncd31iBdnsf4hLxY1qzyXOjCB/s2EmJ326DKzugYtAFraiuiY7LsmpB eEaIv9PcuDhgZ6gzLZa+w== X-UI-Out-Filterresults: notjunk:1; V01:K0:u1s8PVbB9LY=:FUFo++Ur7/Fpp8lWZcWs1J i6L8efQZXNG9IOIdVwXRE08syWAWThV8YfhxtjPydEuzvYYxA4TeYLj8lOwleH1+fWQPSO1s9 PUHIyfH8f4DhaIcmE8BcY8XYiQO0WXeX9LFsXNWMmOP3NmcTyhv7Wpd64gP3Wy2orsl+RW2AR Idhn3/lQcFZfZCaa+uO5CNu8wcvVL8a831HEp+M/t0QcDCnX3AmAgMb3lYVgqk7gdhuc4s4X3 s78MoX5KG91FllQJ9mq/fgPBUTz92Y3rwqMG/uymBBQTqbh0HpcwfnZVIEcHIR56UXh2vGbhl CN+t+C30DSNXqS8cTjw4nQRoGfYcRgxdSbD97Myd/7yw6AJ4jdOd+DcOqc7gdt+4nuEWkepVf T9Qd0ua0KSFSHUHZHP4IALz5zioeVc35b8a27o93EisdAVc5PfravUEpgI3EI12VOWG00Rjz4 IwV9KDqzsBUUxFGx+a20xXXGhfpt4hbD52lGRuINvBOIU/h5hC0Z3lvVNxivSAwbwoEgj08ZB SUA1M9kg8w8IqZq4hpiCP4yhw1iAa9MRtYuTfE/1rq5/tK7AlehxqCbXGA2fj4kZV5Y1NkfBf chU1DzuagRAPx7s0HzjKGRL/iYoj5rAbiLtDROEIe22IA+6WhlIH3xjXsDwIceawt20KzpDqF TKbu3uup1M3ojxtbIar7sUuuUZwIMEyOJZXKpCw6ExAYPH1TqpHjbxsaMuFfO6nnpu6I= 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 --- Makefile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) -- 2.7.0 diff --git a/Makefile b/Makefile index 9092c16fa6cf..352f55ccc54e 100644 --- a/Makefile +++ b/Makefile @@ -617,7 +617,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