From mboxrd@z Thu Jan 1 00:00:00 1970 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 3EF49C7115D for ; Fri, 20 Jun 2025 11:18:35 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5672310EB50; Fri, 20 Jun 2025 11:18:34 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.b="a0zxzlzK"; dkim-atps=neutral Received: from sea.source.kernel.org (sea.source.kernel.org [172.234.252.31]) by gabe.freedesktop.org (Postfix) with ESMTPS id 30CBF10E21B; Fri, 20 Jun 2025 11:18:31 +0000 (UTC) Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sea.source.kernel.org (Postfix) with ESMTP id F3C7B4A28A; Fri, 20 Jun 2025 11:18:30 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C6339C4CEE3; Fri, 20 Jun 2025 11:18:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1750418310; bh=GzeWP4djQPFAJn699mpS/mLYTmBt8cmn0T9XsL6bfQw=; h=From:To:Cc:Subject:Date:From; b=a0zxzlzKAh+IvrQIpt4x3A3DeiYbTWKo+AkpLk1sljVMr/AQI4ohgXpAKTY2eM0DP QTTilxgSkDIrLQKahcMWc23bvfLKlGJe7cflmVHvAr5krdnINxbmcJ0kjqODZdVVdm gARq6R51AvFWDxKq9HanJakEIZTX/IONIS0YzROSralXTIQ9w/a7VJL96KHH4KfvWs ieP54O81vZA2Hg2DVxBBK8MQyfX/rbSwjkkctGDRpJdyvdNoJJ/QTL3/0leEqr8Zto zMIoMqca0X4k6i+hLIWuoN644TSIbnSvpAj8MY0WVLUTGfDiGCO0TsI6CppMNvtz+0 a5qDzlHk85Elw== From: Arnd Bergmann To: Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , Tvrtko Ursulin , David Airlie , Simona Vetter , Nathan Chancellor , Tzung-Bi Shih , Ashutosh Dixit , Umesh Nerlige Ramappa Cc: Arnd Bergmann , Nick Desaulniers , Bill Wendling , Justin Stitt , Lucas De Marchi , Matt Roper , =?UTF-8?q?Ville=20Syrj=C3=A4l=C3=A4?= , Nam Cao , intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev Subject: [PATCH] i915: fix build error some more Date: Fri, 20 Jun 2025 13:18:18 +0200 Message-Id: <20250620111824.3395007-1-arnd@kernel.org> X-Mailer: git-send-email 2.39.5 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Arnd Bergmann An earlier patch fixed a build failure with clang, but I still see the same problem with some configurations using gcc: drivers/gpu/drm/i915/i915_pmu.c: In function 'config_mask': include/linux/compiler_types.h:568:38: error: call to '__compiletime_assert_462' declared with attribute error: BUILD_BUG_ON failed: bit > BITS_PER_TYPE(typeof_member(struct i915_pmu, enable)) - 1 drivers/gpu/drm/i915/i915_pmu.c:116:3: note: in expansion of macro 'BUILD_BUG_ON' 116 | BUILD_BUG_ON(bit > As I understand it, the problem is that the function is not always fully inlined, but the __builtin_constant_p() can still evaluate the argument as being constant. Marking it as __always_inline so far works for me in all configurations. Fixes: a7137b1825b5 ("drm/i915/pmu: Fix build error with GCOV and AutoFDO enabled") Fixes: a644fde77ff7 ("drm/i915/pmu: Change bitmask of enabled events to u32") Signed-off-by: Arnd Bergmann --- drivers/gpu/drm/i915/i915_pmu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/i915_pmu.c b/drivers/gpu/drm/i915/i915_pmu.c index 990bfaba3ce4..5bc696bfbb0f 100644 --- a/drivers/gpu/drm/i915/i915_pmu.c +++ b/drivers/gpu/drm/i915/i915_pmu.c @@ -108,7 +108,7 @@ static unsigned int config_bit(const u64 config) return other_bit(config); } -static u32 config_mask(const u64 config) +static __always_inline u32 config_mask(const u64 config) { unsigned int bit = config_bit(config); -- 2.39.5