All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@intel.com>
To: dri-devel@lists.freedesktop.org
Cc: jani.nikula@intel.com, intel-gfx@lists.freedesktop.org
Subject: [PATCH 6/6] drm: Add CONFIG_DRM_WERROR
Date: Wed, 10 Jan 2024 19:39:16 +0200	[thread overview]
Message-ID: <0daf415493377f0a06970dba9247ebbbdfb79220.1704908087.git.jani.nikula@intel.com> (raw)
In-Reply-To: <cover.1704908087.git.jani.nikula@intel.com>

Add kconfig to enable -Werror subsystem wide. This is useful for
development and CI to keep the subsystem warning free, while avoiding
issues outside of the subsystem that kernel wide CONFIG_WERROR=y might
hit.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
 drivers/gpu/drm/Kconfig  | 18 ++++++++++++++++++
 drivers/gpu/drm/Makefile |  3 +++
 2 files changed, 21 insertions(+)

diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig
index 6ec33d36f3a4..36a00cba2540 100644
--- a/drivers/gpu/drm/Kconfig
+++ b/drivers/gpu/drm/Kconfig
@@ -414,3 +414,21 @@ config DRM_LIB_RANDOM
 config DRM_PRIVACY_SCREEN
 	bool
 	default n
+
+config DRM_WERROR
+	bool "Compile the drm subsystem with warnings as errors"
+	# As this may inadvertently break the build, only allow the user
+	# to shoot oneself in the foot iff they aim really hard
+	depends on EXPERT
+	# We use the dependency on !COMPILE_TEST to not be enabled in
+	# allmodconfig or allyesconfig configurations
+	depends on !COMPILE_TEST
+	default n
+	help
+	  A kernel build should not cause any compiler warnings, and this
+	  enables the '-Werror' flag to enforce that rule in the drm subsystem.
+
+	  The drm subsystem enables more warnings than the kernel default, so
+	  this config option is disabled by default.
+
+	  If in doubt, say N.
diff --git a/drivers/gpu/drm/Makefile b/drivers/gpu/drm/Makefile
index 8b6be830f7c3..b7fd3e58b7af 100644
--- a/drivers/gpu/drm/Makefile
+++ b/drivers/gpu/drm/Makefile
@@ -32,6 +32,9 @@ subdir-ccflags-y += -Wno-sign-compare
 endif
 # --- end copy-paste
 
+# Enable -Werror in CI and development
+subdir-ccflags-$(CONFIG_DRM_WERROR) += -Werror
+
 drm-y := \
 	drm_aperture.o \
 	drm_atomic.o \
-- 
2.39.2


  parent reply	other threads:[~2024-01-10 17:40 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-10 17:39 [PATCH 0/6] drm: enable W=1 warnings by default across the subsystem Jani Nikula
2024-01-10 17:39 ` [PATCH 1/6] drm/nouveau/acr/ga102: remove unused but set variable Jani Nikula
2024-01-10 17:39   ` Jani Nikula
2024-01-31 12:50   ` Jani Nikula
2024-01-31 12:50     ` Jani Nikula
2024-01-31 19:01   ` Danilo Krummrich
2024-01-31 19:01     ` Danilo Krummrich
2024-02-01  9:41     ` Jani Nikula
2024-02-01  9:41       ` Jani Nikula
2024-01-10 17:39 ` [PATCH 2/6] drm/nouveau/svm: remove unused but set variables Jani Nikula
2024-01-10 17:39   ` Jani Nikula
2024-01-31 12:51   ` Jani Nikula
2024-01-31 12:51     ` Jani Nikula
2024-01-31 19:10   ` Danilo Krummrich
2024-01-31 19:10     ` Danilo Krummrich
2024-02-01  9:42     ` Jani Nikula
2024-02-01  9:42       ` Jani Nikula
2024-01-10 17:39 ` [PATCH 3/6] drm/amdgpu: prefer snprintf over sprintf Jani Nikula
2024-01-12  4:09   ` kernel test robot
2024-01-12  4:09     ` kernel test robot
2024-01-12  9:07     ` Jani Nikula
2024-01-12  9:07       ` Jani Nikula
2024-01-12 14:57   ` Alex Deucher
2024-01-31 12:48     ` Jani Nikula
2024-01-31 12:48       ` Jani Nikula
2024-01-10 17:39 ` [PATCH 4/6] drm/imx: " Jani Nikula
2024-01-10 17:39   ` Jani Nikula
2024-01-12 10:49   ` kernel test robot
2024-01-12 10:49     ` kernel test robot
2024-01-12 14:20   ` Philipp Zabel
2024-01-31 12:49     ` Jani Nikula
2024-01-10 17:39 ` [PATCH 5/6] drm: enable (most) W=1 warnings by default across the subsystem Jani Nikula
2024-01-10 17:39   ` Jani Nikula
2024-01-10 20:15   ` Hamza Mahfooz
2024-01-10 20:15     ` Hamza Mahfooz
2024-01-11  9:43     ` Jani Nikula
2024-01-11  9:43       ` Jani Nikula
2024-01-10 17:39 ` Jani Nikula [this message]
2024-01-10 20:17   ` [PATCH 6/6] drm: Add CONFIG_DRM_WERROR Hamza Mahfooz
2024-01-10 18:52 ` ✗ Fi.CI.CHECKPATCH: warning for drm: enable W=1 warnings by default across the subsystem (rev2) Patchwork
2024-01-10 18:52 ` ✗ Fi.CI.SPARSE: " Patchwork
2024-01-10 19:03 ` ✓ Fi.CI.BAT: success " Patchwork
2024-01-10 23:00 ` ✗ Fi.CI.IGT: failure " Patchwork
2024-04-04 15:16 ` [PATCH 0/6] drm: enable W=1 warnings by default across the subsystem Aishwarya TCV
2024-04-05  9:57   ` Jani Nikula
2024-04-05 10:28     ` Aishwarya TCV

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0daf415493377f0a06970dba9247ebbbdfb79220.1704908087.git.jani.nikula@intel.com \
    --to=jani.nikula@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.