From nobody Sun Feb 8 08:22:46 2026 Received: from mailtransmit04.runbox.com (mailtransmit04.runbox.com [185.226.149.37]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C3C6C4A2E04 for ; Wed, 21 Jan 2026 14:58:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.226.149.37 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769007492; cv=none; b=ZwvR2VHo3cmzRXC5go+mAsrBr6hql0PyHifwgYSo004OjsNlGzCd1D9j8O8jAyQBXopU2oHfjEofP7rgGARBHUPMRgEHZk2Td09w7lZYwofHOqF3vga/hQw9WHdDR6as3sthRTpqio03gM0HvnkB8UiG/ziBD6Na85kNesrZwbQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769007492; c=relaxed/simple; bh=KnD6lUbvGcRchKcNZZh/x1v8Ivn5Z3m9i5iGppglY/M=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=txXS9NVTQyDxEGn0fCpczemXXAMLaw5XgY4hwllCkPnQ6VISjPpw101RvGwBIdE7lhtWFtCsy5fnra7snH4wHHZcwmEra57XO8i5kzNoizNYcb2WlmjU/uzBOAIiiH4dEzk0eRQLceXoyjJ/eeBsnBjQ9oCu1z8vdluufUyPzfo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=runbox.com; dkim=pass (2048-bit key) header.d=runbox.com header.i=@runbox.com header.b=qLagF0dg; arc=none smtp.client-ip=185.226.149.37 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=runbox.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=runbox.com header.i=@runbox.com header.b="qLagF0dg" Received: from mailtransmit03.runbox ([10.9.9.163] helo=aibo.runbox.com) by mailtransmit04.runbox.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93) (envelope-from ) id 1viZeV-008XC5-AB; Wed, 21 Jan 2026 15:57:47 +0100 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=runbox.com; s=selector2; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To :Message-Id:Date:Subject:Cc:To:From; bh=woWiGteby0nhO3keCjO/XMIhwTt+aq04kL0xpr3EbPg=; b=qLagF0dgYYDg8S2PrryXBn9dXe u01E9/j0t8fFoNRWbmP4RGYkd+TC6D6c5H6/89a7J07kehtzHK9KPDgjicbrvupq9p2WeZOTS3gaE kcgsBJE76RHSrMnfXTMapxfAYRhqcrhwA74jf0EMi5cpiQh8PIZow/HG88vb2LC6H/p6JGH4chQsp ajzohJd8YBsMuEGeJt9KFxBCf8ZxeIOuugeVNYtV0bkLkwIuJSjzg4eIHRg5Ii23WljRXk2eLmkZR Q6EA0su+3xNKD1hrJTN12c43hYnK0Rz5EDTzk7TGUnbSbtq3SqggCVYiQFo2d7IRQHGu9KldnK+9S h4Dx+60Q==; Received: from [10.9.9.72] (helo=submission01.runbox) by mailtransmit03.runbox with esmtp (Exim 4.86_2) (envelope-from ) id 1viZeU-0006kD-JG; Wed, 21 Jan 2026 15:57:47 +0100 Received: by submission01.runbox with esmtpsa [Authenticated ID (1493616)] (TLS1.2:ECDHE_SECP256R1__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.93) id 1viZeT-00GH6h-4t; Wed, 21 Jan 2026 15:57:45 +0100 From: david.laight.linux@gmail.com To: Nathan Chancellor , Greg Kroah-Hartman , Thomas Gleixner , Peter Zijlstra , Ingo Molnar , Mathieu Desnoyers , Arnd Bergmann , linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org, Yury Norov , Lucas De Marchi , Jani Nikula , Vincent Mailhol , Andy Shevchenko , Kees Cook , Andrew Morton Cc: David Laight Subject: [PATCH next 02/14] kbuild: Add W=c for additional compile time checks Date: Wed, 21 Jan 2026 14:57:19 +0000 Message-Id: <20260121145731.3623-3-david.laight.linux@gmail.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20260121145731.3623-1-david.laight.linux@gmail.com> References: <20260121145731.3623-1-david.laight.linux@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: David Laight Some compile time checks significantly bloat the pre-processor output (particularly when the get nested). Since the checks aren't really needed on every compilation enable with W=3Dc (adds -DKBUILD_EXTRA_WARNc) so the checks can be enabled per-build. Make W=3D1 imply W=3Dc so the build-bot includes the checks. As well as reducing the bloat from existing checks (like those in GENMASK() and FIELD_PREP()) it lets additional checks be added while there are still 'false positives' without breaking normal builds. Signed-off-by: David Laight --- scripts/Makefile.warn | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/scripts/Makefile.warn b/scripts/Makefile.warn index 68e6fafcb80c..e8a799850973 100644 --- a/scripts/Makefile.warn +++ b/scripts/Makefile.warn @@ -2,8 +2,9 @@ # =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D # make W=3D... settings # -# There are four warning groups enabled by W=3D1, W=3D2, W=3D3, and W=3De -# They are independent, and can be combined like W=3D12 or W=3D123e. +# There are five warning groups enabled by W=3Dc, W=3D1, W=3D2, W=3D3, and= W=3De +# They are independent, and can be combined like W=3D12 or W=3D123e, +# except that W=3D1 implies W=3Dc. # =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =20 # Default set of warnings, always enabled @@ -109,6 +110,13 @@ KBUILD_CFLAGS +=3D $(call cc-option,-Wenum-conversion) =20 KBUILD_CFLAGS +=3D -Wunused =20 +# +# W=3Dc - Expensive compile-time checks, implied by W=3D1 +# +ifneq ($(findstring c, $(KBUILD_EXTRA_WARN))$(findstring 1, $(KBUILD_EXTRA= _WARN)),) +KBUILD_CPPFLAGS +=3D -DKBUILD_EXTRA_WARNc +endif + # # W=3D1 - warnings which may be relevant and do not occur too often # --=20 2.39.5