mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/chenhuacai/linux-loongson
synced 2025-09-06 13:09:58 +00:00
drm/i915: enable W=1 warnings by default
We enable a bunch more compiler warnings than the kernel defaults. However, they've drifted to become a unique set of warnings, and have increasingly fallen behind from the W=1 set. Align with the W=1 warnings from scripts/Makefile.extrawarn for clarity, by copy-pasting them with s/KBUILD_CFLAGS/subdir-ccflags-y/ to make it easier to compare in the future. Some of the -Wextra warnings do need to be disabled, just like in Makefile.extrawarn, but take care to not disable them for W=2 or W=3 builds, depending on the warning. v2: Add back some -Wextra warning disables (Nathan) Cc: Arnd Bergmann <arnd@arndb.de> Cc: Nick Desaulniers <ndesaulniers@google.com> Cc: Nathan Chancellor <nathan@kernel.org> Cc: Masahiro Yamada <masahiroy@kernel.org> Reviewed-by: Nathan Chancellor <nathan@kernel.org> Reviewed-by: Masahiro Yamada <masahiroy@kernel.org> [Final s/KBUILD_CFLAGS/subdir-ccflags-y/ fix while applying] Signed-off-by: Jani Nikula <jani.nikula@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/69a812273091b6535ddc7f9346289d71bb30f43d.1697009258.git.jani.nikula@intel.com
This commit is contained in:
parent
7e1defac4b
commit
2250c7ead8
@ -3,22 +3,34 @@
|
|||||||
# Makefile for the drm device driver. This driver provides support for the
|
# Makefile for the drm device driver. This driver provides support for the
|
||||||
# Direct Rendering Infrastructure (DRI) in XFree86 4.1.0 and higher.
|
# 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
|
# Unconditionally enable W=1 warnings locally
|
||||||
# trivial mistakes from creeping in. We have to do this piecemeal as we reject
|
# --- begin copy-paste W=1 warnings from scripts/Makefile.extrawarn
|
||||||
# any patch that isn't warning clean, so turning on -Wextra (or W=1) we
|
subdir-ccflags-y += -Wextra -Wunused -Wno-unused-parameter
|
||||||
# need to filter out dubious warnings. Still it is our interest
|
subdir-ccflags-y += -Wmissing-declarations
|
||||||
# to keep running locally with W=1 C=1 until we are completely clean.
|
subdir-ccflags-y += $(call cc-option, -Wrestrict)
|
||||||
#
|
subdir-ccflags-y += -Wmissing-format-attribute
|
||||||
# Note the danger in using -Wextra is that when CI updates gcc we
|
subdir-ccflags-y += -Wmissing-prototypes
|
||||||
# will most likely get a sudden build breakage... Hopefully we will fix
|
subdir-ccflags-y += -Wold-style-definition
|
||||||
# new warnings before CI updates!
|
subdir-ccflags-y += -Wmissing-include-dirs
|
||||||
subdir-ccflags-y := -Wextra
|
|
||||||
subdir-ccflags-y += -Wno-unused-parameter
|
|
||||||
subdir-ccflags-y += -Wno-type-limits
|
|
||||||
subdir-ccflags-y += -Wno-missing-field-initializers
|
|
||||||
subdir-ccflags-y += -Wno-sign-compare
|
|
||||||
subdir-ccflags-y += -Wno-shift-negative-value
|
|
||||||
subdir-ccflags-y += $(call cc-option, -Wunused-but-set-variable)
|
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_I915_WERROR) += -Werror
|
subdir-ccflags-$(CONFIG_DRM_I915_WERROR) += -Werror
|
||||||
|
|
||||||
# Fine grained warnings disable
|
# Fine grained warnings disable
|
||||||
|
Loading…
Reference in New Issue
Block a user