From patchwork Mon Nov 23 16:26:45 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 7684271 Return-Path: X-Original-To: patchwork-linux-kbuild@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 006D49F2E2 for ; Mon, 23 Nov 2015 16:32:26 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2904820748 for ; Mon, 23 Nov 2015 16:32:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4FC7920755 for ; Mon, 23 Nov 2015 16:32:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750972AbbKWQ11 (ORCPT ); Mon, 23 Nov 2015 11:27:27 -0500 Received: from mout.kundenserver.de ([217.72.192.74]:61242 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753558AbbKWQ1T (ORCPT ); Mon, 23 Nov 2015 11:27:19 -0500 Received: from wuerfel.localnet ([134.3.118.24]) by mrelayeu.kundenserver.de (mreue104) with ESMTPSA (Nemesis) id 0MeBiQ-1ZhgmP2iNi-00Pvgj; Mon, 23 Nov 2015 17:26:47 +0100 From: Arnd Bergmann To: Michal Marek Cc: linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kbuild@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH] Kbuild: disable 'maybe-uninitialized' warning for CONFIG_PROFILE_ALL_BRANCHES Date: Mon, 23 Nov 2015 17:26:45 +0100 Message-ID: <3799453.oCg1CdOrtm@wuerfel> User-Agent: KMail/4.11.5 (Linux/3.16.0-10-generic; KDE/4.11.5; x86_64; ; ) MIME-Version: 1.0 X-Provags-ID: V03:K0:gFg6gLe5/Zi+1W6Jc0l+QeRicVIPDCxoAJv24PhkNgqAXVF+HBX wCqV/ym/lkub5QL+aIB41QQw/9s+AH+vchubduf8RTqp0EO97H4uZpGEDXC0BOAGGb4a682 OUBRiYwrwMnjleTrh9Q9rqCv5ARrsaABmh92KRnDIb7vQTDWHzJZXdzNh+gplBADett7yaf WuKDJ8tG6yXD6chIXzF5w== X-UI-Out-Filterresults: notjunk:1; V01:K0:iGOC0L6eQBg=:Ck14Q6p1BZY6mxKawmwpcD jLNg+Nc8yEpgCIcm0389PoGJIhJVYeZrxKEuRALVfmfjS9hgKBb5Nqh0NQgRGIOqx80tIbAvK 0mbogRly86kvXynCm6rLgkd95LVcmLAa5ioa81JkQri/ue6vaiLY/0G+uxaKstoyZVyq9XWhl 9LgntWZalm69mNg8FvFDHBHrvcyQGZocxzsnDJN2IblzK1qVnjf0Chgi5nylhLa9T3d3v29fs JXogM1ffPFOoVzOilTU9yXSUhZKMUxh7Nqfp5Bv3rvEhkBGb6npCRRkCaVWTNhQtS++mJT6ED /MQW2m0t39OEwuzYNsrU2F+86zt02JU2tV6jg0+2bmSbAA0TgJYyXa+Qo6GHYHyy75zB3d8/r doxmQ9QdLcEGKaxxd6eL0evG3ejKu1j7+gOAm63CFF0xG8Dqqg9DCopyXXSY/Gi2Yu7SSik+h jGppiHathYs+xltsa2nz3LdGeIzKQ/h8QUSm/jgfDluxkOEcnu0N579J0gK4EKmbRD5Q9ca8l 7E+BIeefmQwN9MXUcqKcxUXfW6Noxd0tCgecrvCLcAuHqxcDrIVeqpwe10BVRlPY+kpt0OboG cakLIIFWLpJQQJ2/2Z7X6TWWKKMQr0YiyleegbhTQ02rFFkZw6b8catHhR2hqCTSQ09Q3D+/v 0k5QexOud3cd8qF/f85+W0DB/8SQIqqUStH3i89zoWpxCAWbmgWvyEpj3sH4ONei/GbWp54P3 aEjVC/BwHSsSlr5A Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, 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 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 --- To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/Makefile b/Makefile index 5e01a416c6e4..f8b921658f29 100644 --- a/Makefile +++ b/Makefile @@ -626,7 +626,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