All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] drm/i915: Disable -Woverride-init
@ 2017-10-13 16:08 Chris Wilson
  2017-10-13 16:08 ` [PATCH 2/2] drm/i915: Add -Wunused-const-variable to our build Chris Wilson
                   ` (3 more replies)
  0 siblings, 4 replies; 11+ messages in thread
From: Chris Wilson @ 2017-10-13 16:08 UTC (permalink / raw)
  To: intel-gfx; +Cc: Joonas, Jani Nikula, Daniel Vetter, Tomi Sarvela

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.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com
Cc: Jani Nikula <jani.nikula@intel.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Tomi Sarvela <tomi.p.sarvela@intel.com>
---
 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)
 
-- 
2.15.0.rc0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 11+ messages in thread
* [PATCH 1/2] drm/i915: Disable -Woverride-init
@ 2017-01-18 12:18 Chris Wilson
  2017-01-18 15:56 ` Joonas Lahtinen
  0 siblings, 1 reply; 11+ messages in thread
From: Chris Wilson @ 2017-01-18 12:18 UTC (permalink / raw)
  To: intel-gfx; +Cc: Jani Nikula, Daniel Vetter, Tomi Sarvela

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.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com
Cc: Jani Nikula <jani.nikula@intel.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Tomi Sarvela <tomi.p.sarvela@intel.com>
---
 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 91136b425f77..24cc3c7f814d 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-$(CONFIG_DRM_I915_SELFTEST) += -I$(src) -I$(src)/selftests
 subdir-ccflags-y += \
 	$(call as-instr,movntdqa (%eax)$(comma)%xmm0,-DCONFIG_AS_MOVNTDQA)
-- 
2.11.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2017-10-13 19:34 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-10-13 16:08 [PATCH 1/2] drm/i915: Disable -Woverride-init Chris Wilson
2017-10-13 16:08 ` [PATCH 2/2] drm/i915: Add -Wunused-const-variable to our build Chris Wilson
2017-10-13 16:48   ` Ville Syrjälä
2017-10-13 16:18 ` [PATCH 1/2] drm/i915: Disable -Woverride-init Michal Wajdeczko
2017-10-13 16:47 ` Ville Syrjälä
2017-10-13 19:34   ` Chris Wilson
2017-10-13 17:45 ` ✗ Fi.CI.BAT: failure for series starting with [1/2] " Patchwork
  -- strict thread matches above, loose matches on Subject: below --
2017-01-18 12:18 [PATCH 1/2] " Chris Wilson
2017-01-18 15:56 ` Joonas Lahtinen
2017-01-18 16:27   ` Chris Wilson
2017-01-23  8:00     ` Joonas Lahtinen

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.