diff options
author | Nathan Chancellor <nathan@kernel.org> | 2022-04-11 21:12:50 +0300 |
---|---|---|
committer | Rob Clark <robdclark@chromium.org> | 2022-04-12 04:35:31 +0300 |
commit | 390d645877ffd6dcb55f162d618045b2779217b3 (patch) | |
tree | 989c83f101a2e11e5d14a94f886e410cb067a43d /Documentation | |
parent | 8b2c181e3dcf7562445af6702ee94aaedcbe13c8 (diff) | |
download | linux-390d645877ffd6dcb55f162d618045b2779217b3.tar.xz |
drm/msm/gpu: Avoid -Wunused-function with !CONFIG_PM_SLEEP
When building with CONFIG_PM=y and CONFIG_PM_SLEEP=n (such as ARCH=riscv
allmodconfig), the following warnings/errors occur:
drivers/gpu/drm/msm/adreno/adreno_device.c:679:12: error: 'adreno_system_resume' defined but not used [-Werror=unused-function]
679 | static int adreno_system_resume(struct device *dev)
| ^~~~~~~~~~~~~~~~~~~~
drivers/gpu/drm/msm/adreno/adreno_device.c:655:12: error: 'adreno_system_suspend' defined but not used [-Werror=unused-function]
655 | static int adreno_system_suspend(struct device *dev)
| ^~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
These functions are only used in SET_SYSTEM_SLEEP_PM_OPS(), which
evaluates to empty when CONFIG_PM_SLEEP is not set, making these
functions unused.
To resolve this, use the SYSTEM_SLEEP_PM_OPS() and RUNTIME_PM_OPS()
macros, which were introduced in commit 1a3c7bb08826 ("PM: core: Add new
*_PM_OPS macros, deprecate old ones"). They are designed to avoid these
compiler warnings while still guarding their use on
CONFIG_PM{,_SLEEP}=y.
Fixes: 7e4167c9e021 ("drm/msm/gpu: Park scheduler threads for system suspend")
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Link: https://lore.kernel.org/r/20220411181249.2758344-1-nathan@kernel.org
Signed-off-by: Rob Clark <robdclark@chromium.org>
Diffstat (limited to 'Documentation')
0 files changed, 0 insertions, 0 deletions