From nobody Sun Dec 14 06:16:57 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4793FC5AD4C for ; Thu, 23 Nov 2023 11:06:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345042AbjKWLGJ (ORCPT ); Thu, 23 Nov 2023 06:06:09 -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: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" 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 +=3D -Wno-format-security KBUILD_CFLAGS +=3D -Wno-trigraphs KBUILD_CFLAGS +=3D $(call cc-disable-warning,frame-address,) KBUILD_CFLAGS +=3D $(call cc-disable-warning, address-of-packed-member) +KBUILD_CFLAGS +=3D -Wmissing-declarations +KBUILD_CFLAGS +=3D -Wmissing-prototypes =20 ifneq ($(CONFIG_FRAME_WARN),0) KBUILD_CFLAGS +=3D -Wframe-larger-than=3D$(CONFIG_FRAME_WARN) @@ -95,10 +97,8 @@ export KBUILD_EXTRA_WARN ifneq ($(findstring 1, $(KBUILD_EXTRA_WARN)),) =20 KBUILD_CFLAGS +=3D -Wextra -Wunused -Wno-unused-parameter -KBUILD_CFLAGS +=3D -Wmissing-declarations KBUILD_CFLAGS +=3D $(call cc-option, -Wrestrict) KBUILD_CFLAGS +=3D -Wmissing-format-attribute -KBUILD_CFLAGS +=3D -Wmissing-prototypes KBUILD_CFLAGS +=3D -Wold-style-definition KBUILD_CFLAGS +=3D -Wmissing-include-dirs KBUILD_CFLAGS +=3D $(call cc-option, -Wunused-but-set-variable) --=20 2.39.2