From patchwork Wed Nov 8 12:58:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 1861791 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=eNsPlZDJ; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ozlabs.org (client-ip=2404:9400:2:0:216:3eff:fee1:b9f1; helo=lists.ozlabs.org; envelope-from=linuxppc-dev-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org; receiver=patchwork.ozlabs.org) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2404:9400:2:0:216:3eff:fee1:b9f1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4SQfB15DNkz1yRF for ; Thu, 9 Nov 2023 08:59:05 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=eNsPlZDJ; dkim-atps=neutral Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4SQfB10Rtvz3vx1 for ; Thu, 9 Nov 2023 08:59:05 +1100 (AEDT) X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=eNsPlZDJ; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=kernel.org (client-ip=2604:1380:4601:e00::1; helo=ams.source.kernel.org; envelope-from=arnd@kernel.org; receiver=lists.ozlabs.org) Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4SQQK63Tb7z3cNV for ; Thu, 9 Nov 2023 00:04:26 +1100 (AEDT) Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by ams.source.kernel.org (Postfix) with ESMTP id EF897B81C6B; Wed, 8 Nov 2023 13:04:23 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D9689C433C9; Wed, 8 Nov 2023 13:04:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1699448663; bh=kegMIl+DMnSqVAHEcD2O4VmQR89XR3LaLbspvw04Tng=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eNsPlZDJtmEkAPMbBG5R4qhHte1qNJj5hivdXnhMnQEYxjWoPW4joiDtxOU68W74A xYdGgBhCICOT3rUTOeUYm0Hc/0LeKHn3J/Gekc8+KTnNnPXVjHuBsHwOaN69BFuuvL wN1TtfsrekXIsK010uWdjCGU5Ld5U7BPhDH+yIeFwi0DnKAb/YUl2oaW2yuZulDgnz pUDyk70EhXQiruCjugsUuCxET23RnQ3wREunYYRXMrJO64AqO0M74uvMADhK6JM0RJ aJLD9+iPedZDT4sOV2VEhIsUeQxuPkYhEBdNhQp3p2/UHNMVvYSvjwsw+1CsJtL+wm Cl+RPNk7mv6uQ== From: Arnd Bergmann To: Andrew Morton , linux-kernel@vger.kernel.org, Masahiro Yamada , linux-kbuild@vger.kernel.org Subject: [PATCH 22/22] Makefile.extrawarn: turn on missing-prototypes globally Date: Wed, 8 Nov 2023 13:58:43 +0100 Message-Id: <20231108125843.3806765-23-arnd@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231108125843.3806765-1-arnd@kernel.org> References: <20231108125843.3806765-1-arnd@kernel.org> MIME-Version: 1.0 X-Mailman-Approved-At: Thu, 09 Nov 2023 08:41:16 +1100 X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , Juri Lelli , linux-fbdev@vger.kernel.org, x86@kernel.org, loongarch@lists.linux.dev, linux-sh@vger.kernel.org, Peter Zijlstra , Catalin Marinas , dri-devel@lists.freedesktop.org, netdev@vger.kernel.org, Guo Ren , Anil S Keshavamurthy , sparclinux@vger.kernel.org, linux-riscv@lists.infradead.org, Vincenzo Frascino , Will Deacon , Greg Ungerer , Nicolas Schier , linux-s390@vger.kernel.org, Vincent Guittot , Yoshinori Sato , Helge Deller , Huacai Chen , Russell King , Ard Biesheuvel , linux-bcachefs@vger.kernel.org, Ingo Molnar , Vineet Gupta , "Naveen N. Rao" , Matt Turner , linux-snps-arc@lists.infradead.org, Rich Felker , linux-trace-kernel@vger.kernel.org, Palmer Dabbelt , Kees Cook , Arnd Bergmann , Heiko Carstens , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Richard Henderson , linuxppc-dev@lists.ozlabs.org, Nicholas Piggin , Nathan Chancellor , linux-m68k@lists.linux-m68k.org, linux-csky@vger.kernel.org, Ivan Kokshaysky , Steven Rostedt , Andy Lutomirski , John Paul Adrian Glaubitz , Thomas Gleixner , linux-arm-kernel@lists.infradead.org, Michal Simek , Thomas Bogendoerfer , linux-parisc@vger.kernel.org, Timur Tabi , Geoff Levand , Greg Kroah-Hartman , Kent Overstreet , Nick Desaulniers , linux-mips@vger.kernel.org, Sudip Mukherjee , Dinh Nguyen , linux-usb@vger.kernel.org, Palmer Dabbelt , Masami Hiramatsu , linux-alpha@vger.kernel.org, linux-mtd@lists.infradead.org, David Woodhouse , "David S. Miller" , Al Viro Errors-To: linuxppc-dev-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" 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 2fe6f2828d37..c9725685aa76 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)