All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@linux.intel.com>
To: Lucas De Marchi <lucas.demarchi@intel.com>,
	intel-xe@lists.freedesktop.org
Cc: Lucas De Marchi <lucas.demarchi@intel.com>,
	Rodrigo Vivi <rodrigo.vivi@intel.com>
Subject: Re: [PATCH 3/3] drm/xe: Enable W=1 warnings by default
Date: Fri, 15 Dec 2023 10:56:04 +0200	[thread overview]
Message-ID: <87h6kjx2sb.fsf@intel.com> (raw)
In-Reply-To: <20231214213954.3223263-3-lucas.demarchi@intel.com>

On Thu, 14 Dec 2023, Lucas De Marchi <lucas.demarchi@intel.com> wrote:
> Like done in commit 2250c7ead8ad ("drm/i915: enable W=1 warnings by default")
> for i915, enable W=1 warnings by default in xe.

Acked-by: Jani Nikula <jani.nikula@intel.com>

once the build is clean.

There seems to be interest in doing this the same way drm subsystem wide
[1], but getting the build cleaned up there is a bit bigger task...

BR,
Jani.

[1] https://lore.kernel.org/r/20231129181219.1237887-1-jani.nikula@intel.com


>
> Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
> ---
>  drivers/gpu/drm/xe/Makefile | 47 ++++++++++++++++++++++---------------
>  1 file changed, 28 insertions(+), 19 deletions(-)
>
> diff --git a/drivers/gpu/drm/xe/Makefile b/drivers/gpu/drm/xe/Makefile
> index f4ae063a7005..6790c049d89e 100644
> --- a/drivers/gpu/drm/xe/Makefile
> +++ b/drivers/gpu/drm/xe/Makefile
> @@ -3,25 +3,34 @@
>  # Makefile for the drm device driver.  This driver provides support for the
>  # Direct Rendering Infrastructure (DRI) in XFree86 4.1.0 and higher.
>  
> -# Add a set of useful warning flags and enable -Werror for CI to prevent
> -# trivial mistakes from creeping in. We have to do this piecemeal as we reject
> -# any patch that isn't warning clean, so turning on -Wall -Wextra (or W=1) we
> -# need to filter out dubious warnings.  Still it is our interest
> -# to keep running locally with W=1 C=1 until we are completely clean.
> -#
> -# Note the danger in using -Wall -Wextra is that when CI updates gcc we
> -# will most likely get a sudden build breakage... Hopefully we will fix
> -# new warnings before CI updates!
> -subdir-ccflags-y := -Wall -Wextra
> -subdir-ccflags-y += $(call cc-disable-warning, unused-parameter)
> -subdir-ccflags-y += $(call cc-disable-warning, type-limits)
> -subdir-ccflags-y += $(call cc-disable-warning, missing-field-initializers)
> -subdir-ccflags-y += $(call cc-disable-warning, unused-but-set-variable)
> -# clang warnings
> -subdir-ccflags-y += $(call cc-disable-warning, sign-compare)
> -subdir-ccflags-y += $(call cc-disable-warning, sometimes-uninitialized)
> -subdir-ccflags-y += $(call cc-disable-warning, initializer-overrides)
> -subdir-ccflags-y += $(call cc-disable-warning, frame-address)
> +# Unconditionally enable W=1 warnings locally
> +# --- begin copy-paste W=1 warnings from scripts/Makefile.extrawarn
> +subdir-ccflags-y += -Wextra -Wunused -Wno-unused-parameter
> +subdir-ccflags-y += -Wmissing-declarations
> +subdir-ccflags-y += $(call cc-option, -Wrestrict)
> +subdir-ccflags-y += -Wmissing-format-attribute
> +subdir-ccflags-y += -Wmissing-prototypes
> +subdir-ccflags-y += -Wold-style-definition
> +subdir-ccflags-y += -Wmissing-include-dirs
> +subdir-ccflags-y += $(call cc-option, -Wunused-but-set-variable)
> +subdir-ccflags-y += $(call cc-option, -Wunused-const-variable)
> +subdir-ccflags-y += $(call cc-option, -Wpacked-not-aligned)
> +subdir-ccflags-y += $(call cc-option, -Wformat-overflow)
> +subdir-ccflags-y += $(call cc-option, -Wformat-truncation)
> +subdir-ccflags-y += $(call cc-option, -Wstringop-overflow)
> +subdir-ccflags-y += $(call cc-option, -Wstringop-truncation)
> +# The following turn off the warnings enabled by -Wextra
> +ifeq ($(findstring 2, $(KBUILD_EXTRA_WARN)),)
> +subdir-ccflags-y += -Wno-missing-field-initializers
> +subdir-ccflags-y += -Wno-type-limits
> +subdir-ccflags-y += -Wno-shift-negative-value
> +endif
> +ifeq ($(findstring 3, $(KBUILD_EXTRA_WARN)),)
> +subdir-ccflags-y += -Wno-sign-compare
> +endif
> +# --- end copy-paste
> +
> +# Enable -Werror in CI and development
>  subdir-ccflags-$(CONFIG_DRM_XE_WERROR) += -Werror
>  
>  subdir-ccflags-y += -I$(obj) -I$(srctree)/$(src)

-- 
Jani Nikula, Intel

  parent reply	other threads:[~2023-12-15  8:56 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-14 21:39 [PATCH 1/3] drm/xe: Return error if drm_buddy_init() fails Lucas De Marchi
2023-12-14 21:39 ` [PATCH 2/3] drm/xe/bo: Remove unusued variable Lucas De Marchi
2023-12-14 21:46   ` Lucas De Marchi
2023-12-15 23:17     ` Matthew Brost
2023-12-14 21:39 ` [PATCH 3/3] drm/xe: Enable W=1 warnings by default Lucas De Marchi
2023-12-15  0:48   ` Rodrigo Vivi
2023-12-15 14:32     ` Rodrigo Vivi
2023-12-15 16:43       ` Lucas De Marchi
2023-12-15  8:56   ` Jani Nikula [this message]
2023-12-14 23:00 ` ✓ CI.Patch_applied: success for series starting with [1/3] drm/xe: Return error if drm_buddy_init() fails Patchwork
2023-12-14 23:00 ` ✗ CI.checkpatch: warning " Patchwork
2023-12-14 23:01 ` ✓ CI.KUnit: success " Patchwork
2023-12-14 23:08 ` ✓ CI.Build: " Patchwork
2023-12-14 23:09 ` ✓ CI.Hooks: " Patchwork
2023-12-14 23:10 ` ✓ CI.checksparse: " Patchwork
2023-12-14 23:45 ` ✓ CI.BAT: " Patchwork
2023-12-15  0:11 ` [PATCH 1/3] " Matt Roper

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=87h6kjx2sb.fsf@intel.com \
    --to=jani.nikula@linux.intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=lucas.demarchi@intel.com \
    --cc=rodrigo.vivi@intel.com \
    /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.