Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp252352rdh; Thu, 23 Nov 2023 03:08:45 -0800 (PST) X-Google-Smtp-Source: AGHT+IG5Knt6ncCihGZzjrdjzY7XpCtBucLMMcaICT3g2ppZ9ubGCgTi/OxiuVJV3do/+KIsG573 X-Received: by 2002:a17:902:d490:b0:1cf:54e9:88b8 with SMTP id c16-20020a170902d49000b001cf54e988b8mr5450249plg.20.1700737725320; Thu, 23 Nov 2023 03:08:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700737725; cv=none; d=google.com; s=arc-20160816; b=VXE5j2VK4wmYyvRgdaHVg5IEjs6P6H52kYMGRD8dyhIYfC2O4WzjBnPqxHEFK48Zuj 5whIR/YWHetv52niqjwK8X96V/XIH2d/lZ/SEobnT3AzIvGvyqv4xjq6LAVLWN5ou2Tj e1yiaqxbJF/3LL8pgll84VTxnvw1GwhbbPN2GyKYTlAoNJiRubMZgYCHDDDfTIwv2s6s KHG0lxqxFCSw7BF+7zsvamiQb6tUOyW1eZYTuRxbdigDND4KWBBArio9UJwI0yTODtu/ 7jCe/WvxeR3tfYEMT+TLd5atrhdyqW10xdcxTQomBtARfcNPS1KqpjyVYlRDZ8yRR5x7 htFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=rYze3LxaQm9dDIcNdooG57qJkqMXX+QcPmBzWml4s5c=; fh=LymxRYajFInL3HQtiy9B5pCTygWlwodvNtP8nIIYTb8=; b=qOIkw+1ME71j+kMCdTBdDC+FDRtUNRAY6KlPMWarZpFZ6/wdekcaBU+BNAEPEHGQqq f6DpameKpWPNzmMBoqPIJImcPfTXHQkg+9DW46xuZFMI+/NigI11+BKCY3B4i9IrO7b8 B3A0LYO7GC0HWYsvGxoqIsFGEjEjIs/wNblx1uWgKsVqeDewtcHGL7881M1Pau0aY0cH GsIl6saIikzaIho/vmpFdEuMFSzwewPA2mpkC0kTQ5GAq5+7bfK1eyyMjagDGzu+r7Bw IGpXePUwWBdPogAtaRCcfg4dyiCNzuTKtky2QF2bjIVHo0+Dg4WMhvIsEW4TMbTnkbHs vZiw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=e0VyQ7PV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id ij25-20020a170902ab5900b001ca85c6e508si858508plb.558.2023.11.23.03.08.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Nov 2023 03:08:45 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=e0VyQ7PV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 9304F804C499; Thu, 23 Nov 2023 03:06:22 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344939AbjKWLGG (ORCPT + 99 others); Thu, 23 Nov 2023 06:06:06 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54700 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233080AbjKWLF7 (ORCPT ); Thu, 23 Nov 2023 06:05:59 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2D62CD4E for ; Thu, 23 Nov 2023 03:06:01 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E43DDC43395; Thu, 23 Nov 2023 11:05:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1700737561; bh=9L6ia8ZbTYYVbHNB3z9LNyIFtb/pxWEiG5AGGJleqic=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=e0VyQ7PVXrgpHxXuRmTV8Wg6u7K/HjAAIEfu11YSMUUXsJVeV978M2gskJD8Avjb9 ZB5kV6SE67ZAx7fc43cvAKQQcnfZ1BWg4eFGZWUJqIa5on//kgER/9tce+AIoFXgWk zowoZ5/rblNmUh7+n5DSkzof8B68ftWfi/4Bm3uFFM0OiYY9QfU9s/13gVPYGrLWfP dYIN19g0XPcGf5Nmb7Sg/RV1aH2dS4Rz+E9fs2rc8A8QVIcjSUPFmn5jrJzTXH3nKB fJcaV7yYwcK455NpW2ijR7YUCQVt+9Wq2658RaYTVnp6PTXXmkAhjphLHV/fQylLef elAqGL5fRFABA== From: Arnd Bergmann To: Andrew Morton Cc: Arnd Bergmann , "David S. Miller" , David Woodhouse , Dinh Nguyen , Greg Kroah-Hartman , Ivan Kokshaysky , John Paul Adrian Glaubitz , Michael Ellerman , Masahiro Yamada , Matt Turner , Nathan Chancellor , Nicolas Schier , Peter Zijlstra , Rich Felker , Richard Henderson , Richard Weinberger , Stephen Rothwell , Thomas Bogendoerfer , Tudor Ambarus , Yoshinori Sato , linux-arch@vger.kernel.org, linux-alpha@vger.kernel.org, linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mips@vger.kernel.org, linux-mtd@lists.infradead.org, linux-sh@vger.kernel.org, linux-usb@vger.kernel.org, sparclinux@vger.kernel.org, x86@kernel.org, Kees Cook , Palmer Dabbelt Subject: [PATCH v3 6/6] Makefile.extrawarn: turn on missing-prototypes globally Date: Thu, 23 Nov 2023 12:05:06 +0100 Message-Id: <20231123110506.707903-7-arnd@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231123110506.707903-1-arnd@kernel.org> References: <20231123110506.707903-1-arnd@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Thu, 23 Nov 2023 03:06:22 -0800 (PST) From: Arnd Bergmann Over the years we went from > 1000 of warnings to under 100 earlier this year, and I sent patches to address all the ones that I saw with compile testing randcom configs on arm64, arm and x86 kernels. This is a really useful warning, as it catches real bugs when there are mismatched prototypes. In particular with kernel control flow integrity enabled, those are no longer allowed. I have done extensive testing to ensure that there are no new build errors or warnings on any configuration of x86, arm and arm64 builds. I also made sure that at least the both the normal defconfig and an allmodconfig build is clean for arc, csky, loongarch, m68k, microblaze, openrisc, parisc, powerpc, riscv, s390, and xtensa, with the respective maintainers doing most of the patches. At this point, there are five architectures with a number of known regressions: alpha, nios2, mips, sh and sparc. In the previous version of this patch, I had turned off the missing prototype warnings for the 15 architectures that still had issues, but since there are only five left, I think we can leave the rest to the maintainers (Cc'd here) as well. Cc: Richard Henderson Cc: Ivan Kokshaysky Cc: Matt Turner Cc: Dinh Nguyen Cc: Thomas Bogendoerfer Cc: Yoshinori Sato Cc: Rich Felker Cc: John Paul Adrian Glaubitz Cc: "David S. Miller" Cc: linux-alpha@vger.kernel.org Cc: linux-mips@vger.kernel.org Cc: sparclinux@vger.kernel.org Cc: linux-sh@vger.kernel.org Link: https://lore.kernel.org/lkml/20230810141947.1236730-1-arnd@kernel.org/ Reviewed-by: Kees Cook Acked-by: Palmer Dabbelt # RISC-V Signed-off-by: Arnd Bergmann --- scripts/Makefile.extrawarn | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/Makefile.extrawarn b/scripts/Makefile.extrawarn index 1527199161d7..8e9170f932ea 100644 --- a/scripts/Makefile.extrawarn +++ b/scripts/Makefile.extrawarn @@ -17,6 +17,8 @@ KBUILD_CFLAGS += -Wno-format-security KBUILD_CFLAGS += -Wno-trigraphs KBUILD_CFLAGS += $(call cc-disable-warning,frame-address,) KBUILD_CFLAGS += $(call cc-disable-warning, address-of-packed-member) +KBUILD_CFLAGS += -Wmissing-declarations +KBUILD_CFLAGS += -Wmissing-prototypes ifneq ($(CONFIG_FRAME_WARN),0) KBUILD_CFLAGS += -Wframe-larger-than=$(CONFIG_FRAME_WARN) @@ -95,10 +97,8 @@ export KBUILD_EXTRA_WARN ifneq ($(findstring 1, $(KBUILD_EXTRA_WARN)),) KBUILD_CFLAGS += -Wextra -Wunused -Wno-unused-parameter -KBUILD_CFLAGS += -Wmissing-declarations KBUILD_CFLAGS += $(call cc-option, -Wrestrict) KBUILD_CFLAGS += -Wmissing-format-attribute -KBUILD_CFLAGS += -Wmissing-prototypes KBUILD_CFLAGS += -Wold-style-definition KBUILD_CFLAGS += -Wmissing-include-dirs KBUILD_CFLAGS += $(call cc-option, -Wunused-but-set-variable) -- 2.39.2