Re: [PATCH 1/2] drm/i915: Disable -Woverride-init

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 13 Oct 2017 18:08:29 +0200, Chris Wilson <chris@xxxxxxxxxxxxxxxxxx> wrote:

We commonly use an inheritance style approach to device parameters,
where later generations inherit the defaults from earlier generations
and then override settings that change. For example, in i915_pci.c
BDW_FEATURES pulls in HSW_FEATURES, makes a few changes for 48bit
contexts and then individual Broadwell stanzas make further adjustments
for different GT configs.

This causes a lot of warnings with make W=1 from -Woverride-init. We
could use
	#pragma GCC diagnostic push
	#pragma GCC diagnostic ignored "-Woverride-init"
	...
	#pragma GCC diagnostic pop
around the offenders, but the pattern is used frequently enough in the
driver to prefer just disabling the warning entirely.

I'm not sure that disabling any warnings globally is a good idea.
What about disabling them just for this single file that uses poor
man's "inheritance"

CFLAGS_i915_pci.o := -Wno-override-init

Michal


Signed-off-by: Chris Wilson <chris@xxxxxxxxxxxxxxxxxx>
Cc: Joonas Lahtinen <joonas.lahtinen@xxxxxxxxxxxxxxx
Cc: Jani Nikula <jani.nikula@xxxxxxxxx>
Cc: Daniel Vetter <daniel.vetter@xxxxxxxx>
Cc: Tomi Sarvela <tomi.p.sarvela@xxxxxxxxx>
---
 drivers/gpu/drm/i915/Makefile | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/Makefile b/drivers/gpu/drm/i915/Makefile
index 66d23b619db1..0bb6e423ecd7 100644
--- a/drivers/gpu/drm/i915/Makefile
+++ b/drivers/gpu/drm/i915/Makefile
@@ -2,7 +2,8 @@
# Makefile for the drm device driver. This driver provides support for the
 # Direct Rendering Infrastructure (DRI) in XFree86 4.1.0 and higher.
-subdir-ccflags-$(CONFIG_DRM_I915_WERROR) := -Werror
+subdir-ccflags-y := -Wno-override-init # used frequently for "inheritance"
+subdir-ccflags-$(CONFIG_DRM_I915_WERROR) += -Werror
 subdir-ccflags-y += \
 	$(call as-instr,movntdqa (%eax)$(comma)%xmm0,-DCONFIG_AS_MOVNTDQA)
_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux