diff mbox series

[v2] drm/i915: Clean up disabled warnings

Message ID 20210914194944.4004260-1-nathan@kernel.org (mailing list archive)
State New, archived
Headers show
Series [v2] drm/i915: Clean up disabled warnings | expand

Commit Message

Nathan Chancellor Sept. 14, 2021, 7:49 p.m. UTC
i915 enables a wider set of warnings with '-Wall -Wextra' then disables
several with cc-disable-warning. If an unknown flag gets added to
KBUILD_CFLAGS when building with clang, all subsequent calls to
cc-{disable-warning,option} will fail, meaning that all of these
warnings do not get disabled [1].

A separate series will address the root cause of the issue by not adding
these flags when building with clang [2]; however, the symptom of these
extra warnings appearing can be addressed separately by just removing
the calls to cc-disable-warning, which makes the build ever so slightly
faster because the compiler does not need to be called as much before
building.

The following warnings are supported by GCC 4.9 and clang 10.0.1, which
are the minimum supported versions of these compilers so the call to
cc-disable-warning is not necessary. Masahiro cleaned this up for the
reset of the kernel in commit 4c8dd95a723d ("kbuild: add some extra
warning flags unconditionally").

* -Wmissing-field-initializers
* -Wsign-compare
* -Wtype-limits
* -Wunused-parameter

-Wunused-but-set-variable was implemented in clang 13.0.0 and
-Wframe-address was implemented in clang 12.0.0 so the
cc-disable-warning calls are kept for these two warnings.

Lastly, -Winitializer-overrides is clang's version of -Woverride-init,
which is disabled for the specific files that are problematic. clang
added a compatibility alias in clang 8.0.0 so -Winitializer-overrides
can be removed.

[1]: https://lore.kernel.org/r/202108210311.CBtcgoUL-lkp@intel.com/
[2]: https://lore.kernel.org/r/20210824022640.2170859-1-nathan@kernel.org/

Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
---

v1 -> v2: https://lore.kernel.org/r/20210824232237.2085342-1-nathan@kernel.org/

* Rebase on drm-intel-gt-next now that the prerequisite patch series has
  been merged: https://lore.kernel.org/r/87wnnj13t5.fsf@intel.com/

* Add Nick's reviewed-by tag.

 drivers/gpu/drm/i915/Makefile | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)


base-commit: 43192617f7816bb74584c1df06f57363afd15337

Comments

Nathan Chancellor Sept. 15, 2021, 4:58 p.m. UTC | #1
I don't really see how this patch could be responsible for either this
or the sparse report that I got... it is a simple build time change,
nothing at runtime should be affected.

Cheers,
Nathan

On Wed, Sep 15, 2021 at 03:00:19PM -0000, Patchwork wrote:
> == Series Details ==
> 
> Series: drm/i915: Clean up disabled warnings (rev2)
> URL   : https://patchwork.freedesktop.org/series/94009/
> State : failure
> 
> == Summary ==
> 
> CI Bug Log - changes from CI_DRM_10590 -> Patchwork_21059
> ====================================================
> 
> Summary
> -------
> 
>   **FAILURE**
> 
>   Serious unknown changes coming with Patchwork_21059 absolutely need to be
>   verified manually.
>   
>   If you think the reported changes have nothing to do with the changes
>   introduced in Patchwork_21059, please notify your bug team to allow them
>   to document this new failure mode, which will reduce false positives in CI.
> 
>   External URL: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21059/index.html
> 
> Possible new issues
> -------------------
> 
>   Here are the unknown changes that may have been introduced in Patchwork_21059:
> 
> ### IGT changes ###
> 
> #### Possible regressions ####
> 
>   * igt@core_auth@basic-auth:
>     - fi-kbl-8809g:       [PASS][1] -> [FAIL][2]
>    [1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10590/fi-kbl-8809g/igt@core_auth@basic-auth.html
>    [2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21059/fi-kbl-8809g/igt@core_auth@basic-auth.html
> 
>   * igt@i915_module_load@reload:
>     - fi-skl-6700k2:      [PASS][3] -> [INCOMPLETE][4]
>    [3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10590/fi-skl-6700k2/igt@i915_module_load@reload.html
>    [4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21059/fi-skl-6700k2/igt@i915_module_load@reload.html
> 
>   
> #### Warnings ####
> 
>   * igt@i915_module_load@reload:
>     - fi-kbl-soraka:      [INCOMPLETE][5] ([i915#4136]) -> [INCOMPLETE][6]
>    [5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10590/fi-kbl-soraka/igt@i915_module_load@reload.html
>    [6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21059/fi-kbl-soraka/igt@i915_module_load@reload.html
> 
>   
> #### Suppressed ####
> 
>   The following results come from untrusted machines, tests, or statuses.
>   They do not affect the overall result.
> 
>   * igt@i915_module_load@reload:
>     - {fi-ehl-2}:         [INCOMPLETE][7] ([i915#4136]) -> [INCOMPLETE][8]
>    [7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10590/fi-ehl-2/igt@i915_module_load@reload.html
>    [8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21059/fi-ehl-2/igt@i915_module_load@reload.html
>     - {fi-jsl-1}:         [INCOMPLETE][9] ([i915#4136]) -> [INCOMPLETE][10]
>    [9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10590/fi-jsl-1/igt@i915_module_load@reload.html
>    [10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21059/fi-jsl-1/igt@i915_module_load@reload.html
> 
>   
> Known issues
> ------------
> 
>   Here are the changes found in Patchwork_21059 that come from known issues:
> 
> ### IGT changes ###
> 
> #### Issues hit ####
> 
>   * igt@amdgpu/amd_basic@cs-compute:
>     - fi-cfl-guc:         NOTRUN -> [SKIP][11] ([fdo#109271]) +17 similar issues
>    [11]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21059/fi-cfl-guc/igt@amdgpu/amd_basic@cs-compute.html
> 
>   * igt@amdgpu/amd_basic@cs-sdma:
>     - fi-kbl-7500u:       NOTRUN -> [SKIP][12] ([fdo#109271]) +17 similar issues
>    [12]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21059/fi-kbl-7500u/igt@amdgpu/amd_basic@cs-sdma.html
> 
>   * igt@amdgpu/amd_basic@semaphore:
>     - fi-icl-y:           NOTRUN -> [SKIP][13] ([fdo#109315]) +17 similar issues
>    [13]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21059/fi-icl-y/igt@amdgpu/amd_basic@semaphore.html
> 
>   * igt@amdgpu/amd_cs_nop@fork-gfx0:
>     - fi-icl-u2:          NOTRUN -> [SKIP][14] ([fdo#109315]) +17 similar issues
>    [14]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21059/fi-icl-u2/igt@amdgpu/amd_cs_nop@fork-gfx0.html
> 
>   * igt@core_hotunplug@unbind-rebind:
>     - fi-rkl-guc:         [PASS][15] -> [INCOMPLETE][16] ([i915#4130])
>    [15]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10590/fi-rkl-guc/igt@core_hotunplug@unbind-rebind.html
>    [16]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21059/fi-rkl-guc/igt@core_hotunplug@unbind-rebind.html
>     - fi-cfl-8109u:       [PASS][17] -> [INCOMPLETE][18] ([i915#4130])
>    [17]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10590/fi-cfl-8109u/igt@core_hotunplug@unbind-rebind.html
>    [18]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21059/fi-cfl-8109u/igt@core_hotunplug@unbind-rebind.html
> 
>   * igt@i915_module_load@reload:
>     - fi-skl-guc:         NOTRUN -> [INCOMPLETE][19] ([i915#4136])
>    [19]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21059/fi-skl-guc/igt@i915_module_load@reload.html
> 
>   * igt@runner@aborted:
>     - fi-bsw-nick:        NOTRUN -> [FAIL][20] ([i915#1610] / [i915#3690])
>    [20]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21059/fi-bsw-nick/igt@runner@aborted.html
>     - fi-kbl-8809g:       NOTRUN -> [FAIL][21] ([i915#3363])
>    [21]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21059/fi-kbl-8809g/igt@runner@aborted.html
>     - fi-skl-6700k2:      NOTRUN -> [FAIL][22] ([i915#2426] / [i915#3363])
>    [22]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21059/fi-skl-6700k2/igt@runner@aborted.html
> 
>   
> #### Possible fixes ####
> 
>   * igt@core_hotunplug@unbind-rebind:
>     - fi-cfl-guc:         [INCOMPLETE][23] ([i915#4130]) -> [PASS][24]
>    [23]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10590/fi-cfl-guc/igt@core_hotunplug@unbind-rebind.html
>    [24]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21059/fi-cfl-guc/igt@core_hotunplug@unbind-rebind.html
>     - fi-kbl-7500u:       [INCOMPLETE][25] ([i915#4130]) -> [PASS][26]
>    [25]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10590/fi-kbl-7500u/igt@core_hotunplug@unbind-rebind.html
>    [26]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21059/fi-kbl-7500u/igt@core_hotunplug@unbind-rebind.html
>     - fi-skl-guc:         [INCOMPLETE][27] ([i915#4130]) -> [PASS][28]
>    [27]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10590/fi-skl-guc/igt@core_hotunplug@unbind-rebind.html
>    [28]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21059/fi-skl-guc/igt@core_hotunplug@unbind-rebind.html
> 
>   * igt@i915_module_load@reload:
>     - fi-icl-u2:          [INCOMPLETE][29] ([i915#4136]) -> [PASS][30]
>    [29]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10590/fi-icl-u2/igt@i915_module_load@reload.html
>    [30]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21059/fi-icl-u2/igt@i915_module_load@reload.html
>     - fi-kbl-guc:         [INCOMPLETE][31] -> [PASS][32]
>    [31]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10590/fi-kbl-guc/igt@i915_module_load@reload.html
>    [32]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21059/fi-kbl-guc/igt@i915_module_load@reload.html
>     - fi-icl-y:           [INCOMPLETE][33] -> [PASS][34]
>    [33]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10590/fi-icl-y/igt@i915_module_load@reload.html
>    [34]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21059/fi-icl-y/igt@i915_module_load@reload.html
> 
>   
>   {name}: This element is suppressed. This means it is ignored when computing
>           the status of the difference (SUCCESS, WARNING, or FAILURE).
> 
>   [fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
>   [fdo#109315]: https://bugs.freedesktop.org/show_bug.cgi?id=109315
>   [i915#1610]: https://gitlab.freedesktop.org/drm/intel/issues/1610
>   [i915#2426]: https://gitlab.freedesktop.org/drm/intel/issues/2426
>   [i915#3363]: https://gitlab.freedesktop.org/drm/intel/issues/3363
>   [i915#3690]: https://gitlab.freedesktop.org/drm/intel/issues/3690
>   [i915#4130]: https://gitlab.freedesktop.org/drm/intel/issues/4130
>   [i915#4136]: https://gitlab.freedesktop.org/drm/intel/issues/4136
> 
> 
> Participating hosts (39 -> 36)
> ------------------------------
> 
>   Additional (1): fi-bsw-nick 
>   Missing    (4): fi-bdw-samus fi-tgl-1115g4 fi-bsw-cyan bat-dg1-6 
> 
> 
> Build changes
> -------------
> 
>   * Linux: CI_DRM_10590 -> Patchwork_21059
> 
>   CI-20190529: 20190529
>   CI_DRM_10590: d1e5e3748daf93e7f98b256958bcf80f67892d8e @ git://anongit.freedesktop.org/gfx-ci/linux
>   IGT_6209: 07d6594ed02f55b68d64fa6dd7f80cfbc1ce4ef8 @ https://gitlab.freedesktop.org/drm/igt-gpu-tools.git
>   Patchwork_21059: 29f43978444f1b90c22423e3a9f4fdbb2902fb62 @ git://anongit.freedesktop.org/gfx-ci/linux
> 
> 
> == Linux commits ==
> 
> 29f43978444f drm/i915: Clean up disabled warnings
> 
> == Logs ==
> 
> For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21059/index.html
Jani Nikula Oct. 4, 2021, 5:43 p.m. UTC | #2
On Tue, 14 Sep 2021, Nathan Chancellor <nathan@kernel.org> wrote:
> i915 enables a wider set of warnings with '-Wall -Wextra' then disables
> several with cc-disable-warning. If an unknown flag gets added to
> KBUILD_CFLAGS when building with clang, all subsequent calls to
> cc-{disable-warning,option} will fail, meaning that all of these
> warnings do not get disabled [1].
>
> A separate series will address the root cause of the issue by not adding
> these flags when building with clang [2]; however, the symptom of these
> extra warnings appearing can be addressed separately by just removing
> the calls to cc-disable-warning, which makes the build ever so slightly
> faster because the compiler does not need to be called as much before
> building.
>
> The following warnings are supported by GCC 4.9 and clang 10.0.1, which
> are the minimum supported versions of these compilers so the call to
> cc-disable-warning is not necessary. Masahiro cleaned this up for the
> reset of the kernel in commit 4c8dd95a723d ("kbuild: add some extra
> warning flags unconditionally").
>
> * -Wmissing-field-initializers
> * -Wsign-compare
> * -Wtype-limits
> * -Wunused-parameter
>
> -Wunused-but-set-variable was implemented in clang 13.0.0 and
> -Wframe-address was implemented in clang 12.0.0 so the
> cc-disable-warning calls are kept for these two warnings.
>
> Lastly, -Winitializer-overrides is clang's version of -Woverride-init,
> which is disabled for the specific files that are problematic. clang
> added a compatibility alias in clang 8.0.0 so -Winitializer-overrides
> can be removed.
>
> [1]: https://lore.kernel.org/r/202108210311.CBtcgoUL-lkp@intel.com/
> [2]: https://lore.kernel.org/r/20210824022640.2170859-1-nathan@kernel.org/
>
> Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
> Signed-off-by: Nathan Chancellor <nathan@kernel.org>

Thanks for the patch, and sorry for the delay.

Exceptionally pushed to drm-intel-gt-next instead of drm-intel-next
because some of the dependencies such as 43192617f781 ("drm/i915: Enable
-Wsometimes-uninitialized") were queued there too.


BR,
Jani.


> ---
>
> v1 -> v2: https://lore.kernel.org/r/20210824232237.2085342-1-nathan@kernel.org/
>
> * Rebase on drm-intel-gt-next now that the prerequisite patch series has
>   been merged: https://lore.kernel.org/r/87wnnj13t5.fsf@intel.com/
>
> * Add Nick's reviewed-by tag.
>
>  drivers/gpu/drm/i915/Makefile | 10 ++++------
>  1 file changed, 4 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/Makefile b/drivers/gpu/drm/i915/Makefile
> index c584188aa15a..fd99374583d5 100644
> --- a/drivers/gpu/drm/i915/Makefile
> +++ b/drivers/gpu/drm/i915/Makefile
> @@ -13,13 +13,11 @@
>  # 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 += -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 += $(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, initializer-overrides)
>  subdir-ccflags-y += $(call cc-disable-warning, frame-address)
>  subdir-ccflags-$(CONFIG_DRM_I915_WERROR) += -Werror
>  
>
> base-commit: 43192617f7816bb74584c1df06f57363afd15337
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/Makefile b/drivers/gpu/drm/i915/Makefile
index c584188aa15a..fd99374583d5 100644
--- a/drivers/gpu/drm/i915/Makefile
+++ b/drivers/gpu/drm/i915/Makefile
@@ -13,13 +13,11 @@ 
 # 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 += -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 += $(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, initializer-overrides)
 subdir-ccflags-y += $(call cc-disable-warning, frame-address)
 subdir-ccflags-$(CONFIG_DRM_I915_WERROR) += -Werror