From: Jani Nikula <jani.nikula@intel.com>
To: Nathan Chancellor <nathan@kernel.org>
Cc: dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org,
intel-xe@lists.freedesktop.org
Subject: Re: [PATCH] drm: enable warnings on unused static inlines
Date: Thu, 05 Sep 2024 10:32:49 +0300 [thread overview]
Message-ID: <87seuer1we.fsf@intel.com> (raw)
In-Reply-To: <20240904223030.GA1944054@thelio-3990X>
On Wed, 04 Sep 2024, Nathan Chancellor <nathan@kernel.org> wrote:
> Hi Jani,
>
> On Wed, Sep 04, 2024 at 03:38:19PM +0300, Jani Nikula wrote:
>> We enable most W=1 warnings by default subsystem wide. Also enable
>> warnings on unused static inlines when building with clang.
>>
>> See also commit 6863f5643dd7 ("kbuild: allow Clang to find unused static
>> inline functions for W=1 build").
>>
>> Cc: Nathan Chancellor <nathan@kernel.org>
>> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
>> ---
>> drivers/gpu/drm/Makefile | 3 +++
>> 1 file changed, 3 insertions(+)
>>
>> diff --git a/drivers/gpu/drm/Makefile b/drivers/gpu/drm/Makefile
>> index 784229d4504d..6bd2cdb08be7 100644
>> --- a/drivers/gpu/drm/Makefile
>> +++ b/drivers/gpu/drm/Makefile
>> @@ -19,6 +19,9 @@ subdir-ccflags-y += $(call cc-option, -Wformat-overflow)
>> # FIXME: fix -Wformat-truncation warnings and uncomment
>> #subdir-ccflags-y += $(call cc-option, -Wformat-truncation)
>> subdir-ccflags-y += $(call cc-option, -Wstringop-truncation)
>> +
>> +subdir-ccflags-y += -DKBUILD_EXTRA_WARN1
>> +
>> # The following turn off the warnings enabled by -Wextra
>> ifeq ($(findstring 2, $(KBUILD_EXTRA_WARN)),)
>> subdir-ccflags-y += -Wno-missing-field-initializers
>> --
>> 2.39.2
>>
>
> I ran this through my test matrix and this is what it found (across
> various configuration options, I can give specifics as necessary):
Thanks, I didn't really expect this would not catch anything. :)
We've already fixed some in drm-misc-next and drm-intel-next, see
below. Will need to fix more before merging, obviously.
BR,
Jani.
> drivers/gpu/drm/bridge/synopsys/dw-hdmi-i2s-audio.c:30:18: warning: unused function 'hdmi_read' [-Wunused-function]
> 30 | static inline u8 hdmi_read(struct dw_hdmi_i2s_audio_data *audio, int offset)
> | ^~~~~~~~~
>
> drivers/gpu/drm/bridge/ti-sn65dsi86.c:1638:19: warning: unused function 'ti_sn_pwm_pin_request' [-Wunused-function]
> 1638 | static inline int ti_sn_pwm_pin_request(struct ti_sn65dsi86 *pdata) { return 0; }
> | ^~~~~~~~~~~~~~~~~~~~~
> drivers/gpu/drm/bridge/ti-sn65dsi86.c:1639:20: warning: unused function 'ti_sn_pwm_pin_release' [-Wunused-function]
> 1639 | static inline void ti_sn_pwm_pin_release(struct ti_sn65dsi86 *pdata) {}
> | ^~~~~~~~~~~~~~~~~~~~~
>
> drivers/gpu/drm/drm_mm.c:152:1: warning: unused function 'drm_mm_interval_tree_insert' [-Wunused-function]
> 152 | INTERVAL_TREE_DEFINE(struct drm_mm_node, rb,
> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 153 | u64, __subtree_last,
> | ~~~~~~~~~~~~~~~~~~~~
> 154 | START, LAST, static inline, drm_mm_interval_tree)
> | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> include/linux/interval_tree_generic.h:38:15: note: expanded from macro 'INTERVAL_TREE_DEFINE'
> 38 | ITSTATIC void ITPREFIX ## _insert(ITSTRUCT *node, \
> | ^~~~~~~~~~~~~~~~~~~
> <scratch space>:38:1: note: expanded from here
> 38 | drm_mm_interval_tree_insert
> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~
> drivers/gpu/drm/drm_mm.c:152:1: warning: unused function 'drm_mm_interval_tree_iter_next' [-Wunused-function]
> 152 | INTERVAL_TREE_DEFINE(struct drm_mm_node, rb,
> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 153 | u64, __subtree_last,
> | ~~~~~~~~~~~~~~~~~~~~
> 154 | START, LAST, static inline, drm_mm_interval_tree)
> | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> include/linux/interval_tree_generic.h:151:33: note: expanded from macro 'INTERVAL_TREE_DEFINE'
> 151 | ITSTATIC ITSTRUCT * \
> | ^
> 152 | ITPREFIX ## _iter_next(ITSTRUCT *node, ITTYPE start, ITTYPE last) \
> | ~~~~~~~~~~~~~~~~~~~~~~
> <scratch space>:50:1: note: expanded from here
> 50 | drm_mm_interval_tree_iter_next
> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
53bd7c1c0077 ("drm/mm: Mark drm_mm_interval_tree*() functions with __maybe_unused")
> drivers/gpu/drm/drm_mm.c:614:20: warning: function 'drm_mm_node_scanned_block' is not needed and will not be emitted [-Wunneeded-internal-declaration]
> 614 | static inline bool drm_mm_node_scanned_block(const struct drm_mm_node *node)
> | ^~~~~~~~~~~~~~~~~~~~~~~~~
461ed4aad018 ("drm/mm: annotate drm_mm_node_scanned_block() with __maybe_unused")
> drivers/gpu/drm/i915/i915_sw_fence.c:97:20: error: unused function 'debug_fence_init_onstack' [-Werror,-Wunused-function]
> 97 | static inline void debug_fence_init_onstack(struct i915_sw_fence *fence)
> | ^~~~~~~~~~~~~~~~~~~~~~~~
fcd9e8afd546 ("drm/i915/fence: Mark debug_fence_init_onstack() with __maybe_unused")
> drivers/gpu/drm/i915/i915_sw_fence.c:118:20: error: unused function 'debug_fence_free' [-Werror,-Wunused-function]
> 118 | static inline void debug_fence_free(struct i915_sw_fence *fence)
> | ^~~~~~~~~~~~~~~~
f99999536128 ("drm/i915/fence: Mark debug_fence_free() with __maybe_unused")
>
> drivers/gpu/drm/imagination/pvr_drv.c:224:1: warning: unused function 'pvr_fw_version_packed' [-Wunused-function]
> 224 | pvr_fw_version_packed(u32 major, u32 minor)
> | ^~~~~~~~~~~~~~~~~~~~~
>
> drivers/gpu/drm/kmb/kmb_dsi.c:822:2: warning: unused function 'set_test_mode_src_osc_freq_target_low_bits' [-Wunused-function]
> 822 | set_test_mode_src_osc_freq_target_low_bits(struct kmb_dsi *kmb_dsi,
> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> drivers/gpu/drm/kmb/kmb_dsi.c:834:2: warning: unused function 'set_test_mode_src_osc_freq_target_hi_bits' [-Wunused-function]
> 834 | set_test_mode_src_osc_freq_target_hi_bits(struct kmb_dsi *kmb_dsi,
> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
> drivers/gpu/drm/meson/meson_dw_hdmi.c:276:20: warning: unused function 'dw_hdmi_dwc_write_bits' [-Wunused-function]
> 276 | static inline void dw_hdmi_dwc_write_bits(struct meson_dw_hdmi *dw_hdmi,
> | ^~~~~~~~~~~~~~~~~~~~~~
>
> drivers/gpu/drm/renesas/rcar-du/rcar_cmm.c:35:19: warning: unused function 'rcar_cmm_read' [-Wunused-function]
> 35 | static inline int rcar_cmm_read(struct rcar_cmm *rcmm, u32 reg)
> | ^~~~~~~~~~~~~
>
> drivers/gpu/drm/stm/ltdc.c:494:35: warning: unused function 'encoder_to_ltdc' [-Wunused-function]
> 494 | static inline struct ltdc_device *encoder_to_ltdc(struct drm_encoder *enc)
> | ^~~~~~~~~~~~~~~
>
> Cheers,
> Nathan
--
Jani Nikula, Intel
next prev parent reply other threads:[~2024-09-05 7:32 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-04 12:38 [PATCH] drm: enable warnings on unused static inlines Jani Nikula
2024-09-04 12:55 ` ✓ CI.Patch_applied: success for " Patchwork
2024-09-04 12:55 ` ✓ CI.checkpatch: " Patchwork
2024-09-04 12:56 ` ✓ CI.KUnit: " Patchwork
2024-09-04 13:08 ` ✓ CI.Build: " Patchwork
2024-09-04 13:10 ` ✓ CI.Hooks: " Patchwork
2024-09-04 13:12 ` ✗ CI.checksparse: warning " Patchwork
2024-09-04 13:18 ` ✗ Fi.CI.SPARSE: " Patchwork
2024-09-04 13:33 ` ✓ Fi.CI.BAT: success " Patchwork
2024-09-04 22:30 ` [PATCH] " Nathan Chancellor
2024-09-05 7:32 ` Jani Nikula [this message]
2024-09-10 10:05 ` Jani Nikula
2024-09-05 12:18 ` ✗ Fi.CI.IGT: failure for " Patchwork
2024-09-06 14:38 ` ✓ CI.FULL: success " Patchwork
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=87seuer1we.fsf@intel.com \
--to=jani.nikula@intel.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=intel-gfx@lists.freedesktop.org \
--cc=intel-xe@lists.freedesktop.org \
--cc=nathan@kernel.org \
/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.