Skip to content

Commit 2f3408c

Browse files
jnikuladanvet
authored andcommitted
drm/i915: fix build for CONFIG_BUG=n
If CONFIG_BUG=n __WARN_printf won't be defined leading to the below build failure. The double underscores should have told us to steer clear of it anyway. drivers/gpu/drm/i915/intel_display.c: In function ‘assert_pll’: drivers/gpu/drm/i915/intel_display.c:1027:2: error: implicit declaration of function ‘__WARN_printf’ [-Werror=implicit-function-declaration] I915_STATE_WARN(cur_state != state, Use WARN(1, ...) instead. It handles CONFIG_BUG=n gracefully and, with the constant condition, a sane compiler should reduce it to __WARN_printf. This is a regression introduced by commit e2c719b Author: Rob Clark <robdclark@gmail.com> Date: Mon Dec 15 13:56:32 2014 -0500 drm/i915: tame the chattermouth (v2) Reported-by: Jim Davis <jim.epost@gmail.com> Reference: http://mid.gmane.org/CA+r1ZhgHTi7bS2irhtuSUs9aO=Br1dumN8=oAOeaMJDZ_ZhwBw@mail.gmail.com Cc: Rob Clark <robdclark@gmail.com> Signed-off-by: Jani Nikula <jani.nikula@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
1 parent 0a87a2d commit 2f3408c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/gpu/drm/i915/i915_drv.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@
8383
int __ret_warn_on = !!(condition); \
8484
if (unlikely(__ret_warn_on)) { \
8585
if (i915.verbose_state_checks) \
86-
__WARN_printf(format); \
86+
WARN(1, format); \
8787
else \
8888
DRM_ERROR(format); \
8989
} \
@@ -94,7 +94,7 @@
9494
int __ret_warn_on = !!(condition); \
9595
if (unlikely(__ret_warn_on)) { \
9696
if (i915.verbose_state_checks) \
97-
__WARN_printf("WARN_ON(" #condition ")\n"); \
97+
WARN(1, "WARN_ON(" #condition ")\n"); \
9898
else \
9999
DRM_ERROR("WARN_ON(" #condition ")\n"); \
100100
} \

0 commit comments

Comments
 (0)