From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 062FD25DAFF; Tue, 11 Mar 2025 15:10:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741705808; cv=none; b=nMzxecfyEfaMxMK2hZ1EfCy5zIpkSvp6YmBXtZGADNVUW5VuGnp9B14N1VuejwhCrz/lyQH8apO99UEDKwwDboc1HAbo1DyAuqObSTNLi3q+v04578QSoiJ1bwHoJUJkf9JEbf30awETE5xAZR7XxSUB/PysqjXv99JrW0rr5yg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741705808; c=relaxed/simple; bh=zXltKyRgoXI49LcXmdpsIHTMetd0FXglqVo5X0YdMqg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=CjNR2ea2Adbp6e9IIIimzVZILRTmVLGmBpDDaigDb0OJ3ROVmvq0rbbES/88BleslY5zmchAaFknNcy81hjQNS9ZP8yWsCRAYqEFlLeE2uUEXzDTJL3JT/G4Z3ErLa/ovDLcoqlfsVrYshNu0d/JekUrL5EfDcjcJ/NHYighbwQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=2OYuYhdx; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="2OYuYhdx" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 81D69C4CEF1; Tue, 11 Mar 2025 15:10:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1741705807; bh=zXltKyRgoXI49LcXmdpsIHTMetd0FXglqVo5X0YdMqg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=2OYuYhdxCSKhNg43nnVw6t200Z+PCj9/+FpKozhUjtZrhrTW5UMSYgeH8AiZQoZ2D YiyXuGb3h4YgsVFTEuusdsIkCZ3VhOz4yMds60cAqzeOoRurZUqDR/AYO6267wGIEC vriSxGOo6bCIkU1deLl5Aus0j3YovzXvwtiCwOdI= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Nathan Chancellor , Arnd Bergmann , Linus Torvalds Subject: [PATCH 5.4 143/328] kbuild: Move -Wenum-enum-conversion to W=2 Date: Tue, 11 Mar 2025 15:58:33 +0100 Message-ID: <20250311145720.593344367@linuxfoundation.org> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250311145714.865727435@linuxfoundation.org> References: <20250311145714.865727435@linuxfoundation.org> User-Agent: quilt/0.68 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 5.4-stable review patch. If anyone has any objections, please let me know. ------------------ From: Nathan Chancellor commit 8f6629c004b193d23612641c3607e785819e97ab upstream. -Wenum-enum-conversion was strengthened in clang-19 to warn for C, which caused the kernel to move it to W=1 in commit 75b5ab134bb5 ("kbuild: Move -Wenum-{compare-conditional,enum-conversion} into W=1") because there were numerous instances that would break builds with -Werror. Unfortunately, this is not a full solution, as more and more developers, subsystems, and distributors are building with W=1 as well, so they continue to see the numerous instances of this warning. Since the move to W=1, there have not been many new instances that have appeared through various build reports and the ones that have appeared seem to be following similar existing patterns, suggesting that most instances of this warning will not be real issues. The only alternatives for silencing this warning are adding casts (which is generally seen as an ugly practice) or refactoring the enums to macro defines or a unified enum (which may be undesirable because of type safety in other parts of the code). Move the warning to W=2, where warnings that occur frequently but may be relevant should reside. Cc: stable@vger.kernel.org Fixes: 75b5ab134bb5 ("kbuild: Move -Wenum-{compare-conditional,enum-conversion} into W=1") Link: https://lore.kernel.org/ZwRA9SOcOjjLJcpi@google.com/ Signed-off-by: Nathan Chancellor Acked-by: Arnd Bergmann Signed-off-by: Linus Torvalds Signed-off-by: Greg Kroah-Hartman --- scripts/Makefile.extrawarn | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) --- a/scripts/Makefile.extrawarn +++ b/scripts/Makefile.extrawarn @@ -36,6 +36,10 @@ KBUILD_CFLAGS += $(call cc-option, -Wstr KBUILD_CFLAGS += -Wno-missing-field-initializers KBUILD_CFLAGS += -Wno-sign-compare +ifdef CONFIG_CC_IS_CLANG +KBUILD_CFLAGS += -Wno-enum-enum-conversion +endif + KBUILD_CPPFLAGS += -DKBUILD_EXTRA_WARN1 else @@ -52,7 +56,6 @@ KBUILD_CFLAGS += $(call cc-disable-warni KBUILD_CFLAGS += $(call cc-disable-warning, unaligned-access) KBUILD_CFLAGS += $(call cc-disable-warning, cast-function-type-strict) KBUILD_CFLAGS += -Wno-enum-compare-conditional -KBUILD_CFLAGS += -Wno-enum-enum-conversion endif endif