Skip to content

Commit 0a793ad

Browse files
committed
drm/i915: Force clean compilation with -Werror
Our driver compiles clean (nowadays thanks to 0day) but for me, at least, it would be beneficial if the compiler threw an error rather than a warning when it found a piece of suspect code. (I use this to compile-check patch series and want to break on the first compiler error in order to fix the patch.) v2: Kick off a new "Debugging" submenu for i915.ko At this point, we applied it to the kernel and promptly kicked it out again as it broke buildbots (due to a compiler warning on 32bits): commit 908d759 Author: Daniel Vetter <[email protected]> Date: Tue May 26 07:46:21 2015 +0200 Revert "drm/i915: Force clean compilation with -Werror" v3: Avoid enabling -Werror for allyesconfig/allmodconfig builds, using COMPILE_TEST as a suitable proxy suggested by Andrew Morton. (Damien) Only make the option available for EXPERT to reinforce that the option should not be casually enabled. Signed-off-by: Chris Wilson <[email protected]> Cc: Jani Nikula <[email protected]> Cc: Damien Lespiau <[email protected]> Reviewed-by: Daniel Vetter <[email protected]> Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent c02e85a commit 0a793ad

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

drivers/gpu/drm/i915/Kconfig.debug

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1+
config DRM_I915_WERROR
2+
bool "Force GCC to throw an error instead of a warning when compiling"
3+
# As this may inadvertently break the build, only allow the user
4+
# to shoot oneself in the foot iff they aim really hard
5+
depends on EXPERT
6+
# We use the dependency on !COMPILE_TEST to not be enabled in
7+
# allmodconfig or allyesconfig configurations
8+
depends on !COMPILE_TEST
9+
default n
10+
help
11+
Add -Werror to the build flags for (and only for) i915.ko.
12+
Do not enable this unless you are writing code for the i915.ko module.
13+
14+
Recommended for driver developers only.
15+
16+
If in doubt, say "N".
17+
118
config DRM_I915_DEBUG
219
bool "Enable additional driver debugging"
320
depends on DRM_I915

drivers/gpu/drm/i915/Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
# Makefile for the drm device driver. This driver provides support for the
33
# Direct Rendering Infrastructure (DRI) in XFree86 4.1.0 and higher.
44

5+
subdir-ccflags-$(CONFIG_DRM_I915_WERROR) := -Werror
6+
57
# Please keep these build lists sorted!
68

79
# core driver code

0 commit comments

Comments
 (0)