Skip to content

Commit d02b210

Browse files
arndbjlahtine-intel
authored andcommitted
drm/i915: fix build error some more
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: a7137b1 ("drm/i915/pmu: Fix build error with GCOV and AutoFDO enabled") Fixes: a644fde ("drm/i915/pmu: Change bitmask of enabled events to u32") Reviewed-by: Rodrigo Vivi <[email protected]> Signed-off-by: Arnd Bergmann <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Rodrigo Vivi <[email protected]> (cherry picked from commit ef69f9d) Signed-off-by: Joonas Lahtinen <[email protected]>
1 parent a3ef3c2 commit d02b210

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/gpu/drm/i915/i915_pmu.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ static unsigned int config_bit(const u64 config)
108108
return other_bit(config);
109109
}
110110

111-
static u32 config_mask(const u64 config)
111+
static __always_inline u32 config_mask(const u64 config)
112112
{
113113
unsigned int bit = config_bit(config);
114114

0 commit comments

Comments
 (0)