* [PATCH v2 0/2] drm/i915: align with W=1 warnings
@ 2023-10-11 7:29 Jani Nikula
2023-10-11 7:29 ` [PATCH v2 1/2] drm/i915: drop -Wall and related disables from cflags as redundant Jani Nikula
2023-10-11 7:29 ` [PATCH v2 2/2] drm/i915: enable W=1 warnings by default Jani Nikula
0 siblings, 2 replies; 6+ messages in thread
From: Jani Nikula @ 2023-10-11 7:29 UTC (permalink / raw)
To: intel-gfx
Cc: linux-kbuild, jani.nikula, Arnd Bergmann, Nick Desaulniers,
Nathan Chancellor, Masahiro Yamada
v2 of https://patchwork.freedesktop.org/series/124718/
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Nick Desaulniers <ndesaulniers@google.com>
Cc: Nathan Chancellor <nathan@kernel.org>
Cc: Masahiro Yamada <masahiroy@kernel.org>
Jani Nikula (2):
drm/i915: drop -Wall and related disables from cflags as redundant
drm/i915: enable W=1 warnings by default
drivers/gpu/drm/i915/Makefile | 44 +++++++++++++++++++++--------------
1 file changed, 27 insertions(+), 17 deletions(-)
--
2.39.2
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH v2 1/2] drm/i915: drop -Wall and related disables from cflags as redundant
2023-10-11 7:29 [PATCH v2 0/2] drm/i915: align with W=1 warnings Jani Nikula
@ 2023-10-11 7:29 ` Jani Nikula
2023-10-11 14:36 ` Masahiro Yamada
2023-10-11 7:29 ` [PATCH v2 2/2] drm/i915: enable W=1 warnings by default Jani Nikula
1 sibling, 1 reply; 6+ messages in thread
From: Jani Nikula @ 2023-10-11 7:29 UTC (permalink / raw)
To: intel-gfx
Cc: linux-kbuild, jani.nikula, Arnd Bergmann, Nick Desaulniers,
Nathan Chancellor, Masahiro Yamada
The kernel top level Makefile, and recently scripts/Makefile.extrawarn,
have included -Wall, and the disables -Wno-format-security and
$(call cc-disable-warning,frame-address,) for a very long time. They're
redundant in our local subdir-ccflags-y and can be dropped.
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>
Acked-by: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
drivers/gpu/drm/i915/Makefile | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/drivers/gpu/drm/i915/Makefile b/drivers/gpu/drm/i915/Makefile
index dec78efa452a..623f81217442 100644
--- a/drivers/gpu/drm/i915/Makefile
+++ b/drivers/gpu/drm/i915/Makefile
@@ -5,22 +5,20 @@
# 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
+# any patch that isn't warning clean, so turning on -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
+# Note the danger in using -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 += -Wno-format-security
+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-disable-warning, frame-address)
subdir-ccflags-$(CONFIG_DRM_I915_WERROR) += -Werror
# Fine grained warnings disable
--
2.39.2
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH v2 2/2] drm/i915: enable W=1 warnings by default
2023-10-11 7:29 [PATCH v2 0/2] drm/i915: align with W=1 warnings Jani Nikula
2023-10-11 7:29 ` [PATCH v2 1/2] drm/i915: drop -Wall and related disables from cflags as redundant Jani Nikula
@ 2023-10-11 7:29 ` Jani Nikula
2023-10-11 14:37 ` Masahiro Yamada
1 sibling, 1 reply; 6+ messages in thread
From: Jani Nikula @ 2023-10-11 7:29 UTC (permalink / raw)
To: intel-gfx
Cc: linux-kbuild, jani.nikula, Arnd Bergmann, Nick Desaulniers,
Nathan Chancellor, Masahiro Yamada
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>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
drivers/gpu/drm/i915/Makefile | 42 ++++++++++++++++++++++-------------
1 file changed, 27 insertions(+), 15 deletions(-)
diff --git a/drivers/gpu/drm/i915/Makefile b/drivers/gpu/drm/i915/Makefile
index 623f81217442..94f84befa38f 100644
--- a/drivers/gpu/drm/i915/Makefile
+++ b/drivers/gpu/drm/i915/Makefile
@@ -3,22 +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 -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 -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 := -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
+# 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)),)
+KBUILD_CFLAGS += -Wno-missing-field-initializers
+KBUILD_CFLAGS += -Wno-type-limits
+KBUILD_CFLAGS += -Wno-shift-negative-value
+endif
+ifeq ($(findstring 3, $(KBUILD_EXTRA_WARN)),)
+KBUILD_CFLAGS += -Wno-sign-compare
+endif
+# --- end copy-paste
+
+# Enable -Werror in CI and development
subdir-ccflags-$(CONFIG_DRM_I915_WERROR) += -Werror
# Fine grained warnings disable
--
2.39.2
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH v2 1/2] drm/i915: drop -Wall and related disables from cflags as redundant
2023-10-11 7:29 ` [PATCH v2 1/2] drm/i915: drop -Wall and related disables from cflags as redundant Jani Nikula
@ 2023-10-11 14:36 ` Masahiro Yamada
0 siblings, 0 replies; 6+ messages in thread
From: Masahiro Yamada @ 2023-10-11 14:36 UTC (permalink / raw)
To: Jani Nikula
Cc: intel-gfx, linux-kbuild, Arnd Bergmann, Nick Desaulniers,
Nathan Chancellor
On Wed, Oct 11, 2023 at 4:29 PM Jani Nikula <jani.nikula@intel.com> wrote:
>
> The kernel top level Makefile, and recently scripts/Makefile.extrawarn,
> have included -Wall, and the disables -Wno-format-security and
> $(call cc-disable-warning,frame-address,) for a very long time. They're
> redundant in our local subdir-ccflags-y and can be dropped.
>
> 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>
> Acked-by: Nick Desaulniers <ndesaulniers@google.com>
> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
> ---
Reviewed-by: Masahiro Yamada <masahiroy@kernel.org>
--
Best Regards
Masahiro Yamada
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v2 2/2] drm/i915: enable W=1 warnings by default
2023-10-11 7:29 ` [PATCH v2 2/2] drm/i915: enable W=1 warnings by default Jani Nikula
@ 2023-10-11 14:37 ` Masahiro Yamada
2023-10-11 20:54 ` Jani Nikula
0 siblings, 1 reply; 6+ messages in thread
From: Masahiro Yamada @ 2023-10-11 14:37 UTC (permalink / raw)
To: Jani Nikula
Cc: intel-gfx, linux-kbuild, Arnd Bergmann, Nick Desaulniers,
Nathan Chancellor
On Wed, Oct 11, 2023 at 4:29 PM Jani Nikula <jani.nikula@intel.com> wrote:
>
> 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>
> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Reviewed-by: Masahiro Yamada <masahiroy@kernel.org>
--
Best Regards
Masahiro Yamada
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v2 2/2] drm/i915: enable W=1 warnings by default
2023-10-11 14:37 ` Masahiro Yamada
@ 2023-10-11 20:54 ` Jani Nikula
0 siblings, 0 replies; 6+ messages in thread
From: Jani Nikula @ 2023-10-11 20:54 UTC (permalink / raw)
To: Masahiro Yamada
Cc: intel-gfx, linux-kbuild, Arnd Bergmann, Nick Desaulniers,
Nathan Chancellor
On Wed, 11 Oct 2023, Masahiro Yamada <masahiroy@kernel.org> wrote:
> On Wed, Oct 11, 2023 at 4:29 PM Jani Nikula <jani.nikula@intel.com> wrote:
>>
>> 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>
>> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
>
> Reviewed-by: Masahiro Yamada <masahiroy@kernel.org>
Thanks for the reviews everyone...
...though we missed some s/KBUILD_CFLAGS/subdir-ccflags-y/ in v2. Fixed
while applying.
BR,
Jani.
--
Jani Nikula, Intel
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2023-10-11 20:54 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-10-11 7:29 [PATCH v2 0/2] drm/i915: align with W=1 warnings Jani Nikula
2023-10-11 7:29 ` [PATCH v2 1/2] drm/i915: drop -Wall and related disables from cflags as redundant Jani Nikula
2023-10-11 14:36 ` Masahiro Yamada
2023-10-11 7:29 ` [PATCH v2 2/2] drm/i915: enable W=1 warnings by default Jani Nikula
2023-10-11 14:37 ` Masahiro Yamada
2023-10-11 20:54 ` Jani Nikula
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox