[Intel-gfx] [PATCH 2/2] drm/i915: Remove -Wno-override-init

Chris Wilson chris at chris-wilson.co.uk
Sat Oct 14 10:12:50 UTC 2017


Mark up the locations where we are intentionally overriding
initialization parameters for inheritance with a local pragma so that we
can enable -Woverride-init globally and catch accidental mistakes.

Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
Cc: Joonas Lahtinen <joonas.lahtinen at linux.intel.com>
Cc: Jani Nikula <jani.nikula at intel.com>
Cc: Daniel Vetter <daniel.vetter at ffwll.ch>
Cc: Tomi Sarvela <tomi.p.sarvela at intel.com>
Cc: Micahal Wajdeczko <michal.wajdeczko at intel.com>
Cc: Ville Syrjälä <ville.syrjala at linux.intel.com>
---
 drivers/gpu/drm/i915/Makefile      | 1 -
 drivers/gpu/drm/i915/i915_pci.c    | 5 +++++
 drivers/gpu/drm/i915/intel_fbdev.c | 5 +++++
 3 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/Makefile b/drivers/gpu/drm/i915/Makefile
index 52f0f8f101ec..e1bbb2565426 100644
--- a/drivers/gpu/drm/i915/Makefile
+++ b/drivers/gpu/drm/i915/Makefile
@@ -15,7 +15,6 @@ subdir-ccflags-y := -Wall -Wextra
 subdir-ccflags-y += $(call cc-option,-Wno-unused-parameter,)
 subdir-ccflags-y += $(call cc-option,-Wno-type-limits,)
 subdir-ccflags-y += $(call cc-option,-Wno-missing-field-initializers,)
-subdir-ccflags-y += $(call cc-option,-Wno-override-init,)
 subdir-ccflags-y += $(call cc-option,-Wno-implicit-fallthrough,)
 subdir-ccflags-$(CONFIG_DRM_I915_WERROR) += -Werror
 
diff --git a/drivers/gpu/drm/i915/i915_pci.c b/drivers/gpu/drm/i915/i915_pci.c
index bf467f30c99b..2ad0738eb2e7 100644
--- a/drivers/gpu/drm/i915/i915_pci.c
+++ b/drivers/gpu/drm/i915/i915_pci.c
@@ -29,6 +29,9 @@
 #include "i915_drv.h"
 #include "i915_selftest.h"
 
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Woverride-init" /* used for inheritance */
+
 #define GEN_DEFAULT_PIPEOFFSETS \
 	.pipe_offsets = { PIPE_A_OFFSET, PIPE_B_OFFSET, \
 			  PIPE_C_OFFSET, PIPE_EDP_OFFSET }, \
@@ -640,6 +643,8 @@ static const struct pci_device_id pciidlist[] = {
 };
 MODULE_DEVICE_TABLE(pci, pciidlist);
 
+#pragma GCC diagnostic pop
+
 static void i915_pci_remove(struct pci_dev *pdev)
 {
 	struct drm_device *dev = pci_get_drvdata(pdev);
diff --git a/drivers/gpu/drm/i915/intel_fbdev.c b/drivers/gpu/drm/i915/intel_fbdev.c
index b8af35187d22..7fc7f83d4b74 100644
--- a/drivers/gpu/drm/i915/intel_fbdev.c
+++ b/drivers/gpu/drm/i915/intel_fbdev.c
@@ -96,6 +96,9 @@ static int intel_fbdev_pan_display(struct fb_var_screeninfo *var,
 	return ret;
 }
 
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Woverride-init" /* used for inheritance */
+
 static struct fb_ops intelfb_ops = {
 	.owner = THIS_MODULE,
 	DRM_FB_HELPER_DEFAULT_OPS,
@@ -107,6 +110,8 @@ static struct fb_ops intelfb_ops = {
 	.fb_blank = intel_fbdev_blank,
 };
 
+#pragma GCC diagnostic pop
+
 static int intelfb_alloc(struct drm_fb_helper *helper,
 			 struct drm_fb_helper_surface_size *sizes)
 {
-- 
2.15.0.rc0



More information about the Intel-gfx mailing list