ClangBuiltLinux / linux

Linux kernel source tree
Other
241 stars 14 forks source link

-Wunused-function in drivers/gpu/drm/i915/ #646

Open nickdesaulniers opened 5 years ago

nickdesaulniers commented 5 years ago

via: https://lore.kernel.org/r/CAKwvOd=7Jf13PDC9Q1FMhZUJQsq7Ggn=wRz5xpRY0YrU6tP9Kw@mail.gmail.com/

drivers/gpu/drm/i915/i915_sw_fence.c:84:20: warning: unused function
'debug_fence_init_onstack' [-Wunused-function]
static inline void debug_fence_init_onstack(struct i915_sw_fence *fence)
                   ^
drivers/gpu/drm/i915/i915_sw_fence.c:105:20: warning: unused function
'debug_fence_free' [-Wunused-function]
static inline void debug_fence_free(struct i915_sw_fence *fence)
                   ^

The first looks fishy (grep -r debug_fence_init_onstack), the second only has a callsite ifdef CONFIG_DRM_I915_SW_FENCE_DEBUG_OBJECTS.

drivers/gpu/drm/i915/intel_guc_submission.c:1117:20: warning: unused
function 'ctx_save_restore_disabled' [-Wunused-function]
static inline bool ctx_save_restore_disabled(struct intel_context *ce)
                   ^
drivers/gpu/drm/i915/display/intel_hdmi.c:1696:26: warning: unused
function 'intel_hdmi_hdcp2_protocol' [-Wunused-function]
enum hdcp_wired_protocol intel_hdmi_hdcp2_protocol(void)
                         ^
nathanchance commented 5 years ago

Ah right, drivers/gpu/drm/i915 enables -Wall after all of the warnings are disabled in the main Makefile or scripts/Kbuild.include...

tinti commented 3 years ago

Is this fixed by https://github.com/torvalds/linux/commit/6863f5643dd717376c2fdc85a47a00f9d738a834 ?

nickdesaulniers commented 3 years ago

no

$ make LLVM=1 LLVM_IAS=1 -j72 drivers/gpu/drm/i915/ W=1
...
drivers/gpu/drm/i915/i915_sw_fence.c:95:20: warning: unused function 'debug_fence_init_onstack' [-Wunused-function]
static inline void debug_fence_init_onstack(struct i915_sw_fence *fence)
                   ^
drivers/gpu/drm/i915/i915_sw_fence.c:116:20: warning: unused function 'debug_fence_free' [-Wunused-function]
static inline void debug_fence_free(struct i915_sw_fence *fence)
                   ^

0 day bot has also reported this a few times: https://lore.kernel.org/lkml/202101081525.Gpv8oFGf-lkp@intel.com/