[Intel-gfx] [PATCH 1/2] drm/i915: Disable -Woverride-init
Ville Syrjälä
ville.syrjala at linux.intel.com
Fri Oct 13 16:47:25 UTC 2017
On Fri, Oct 13, 2017 at 05:08:29PM +0100, Chris Wilson 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.
>
> 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>
> ---
> 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"
This doesn't seem to override what W=n does so not sure why we'd need it
here, unless we add more warning flags ourselves. Or does you gcc spew
these without W=1?
Looks like I can can actually do
subdir-ccflags-y := -Wall -Wextra -Wno-unused-parameter -Wno-type-limits
-Wno-missing-field-initializers -Wno-override-init
without any warnings with gcc 5.4.
-Wunused-but-set-variable reveals some more (noticed those when I ran
with W=1). Most look like easy to silence. The atomic interator macros
seem to trigger this all the time however, which may not be so easy to
sort out. Not sure.
> +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 at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
--
Ville Syrjälä
Intel OTC
More information about the Intel-gfx
mailing list