]> git.itanic.dy.fi Git - linux-stable/commit
drm/amdgpu: Move clocks closer to its only usage in amdgpu_parse_cg_state()
authorNathan Chancellor <nathan@kernel.org>
Thu, 15 Jun 2023 17:06:09 +0000 (10:06 -0700)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 23 Jun 2023 19:36:12 +0000 (15:36 -0400)
commit44762718b391b5ad7bd226a7a3badfb93248ad3b
tree5c1ba83ea3c4eb47d333d771dcdaefe90c1c4eec
parentfd21987274463a439c074b8f3c93d3b132e4c031
drm/amdgpu: Move clocks closer to its only usage in amdgpu_parse_cg_state()

After commit 8020f0f9316b ("drm/amd/amdgpu: enable W=1 for amdgpu"),
there is an instance of -Wunused-const-variable when CONFIG_DEBUG_FS is
disabled:

  drivers/gpu/drm/amd/amdgpu/../pm/amdgpu_pm.c:38:34: error: unused variable 'clocks' [-Werror,-Wunused-const-variable]
     38 | static const struct cg_flag_name clocks[] = {
        |                                  ^
  1 error generated.

clocks is only used when CONFIG_DEBUG_FS is set, so move the definition
into the CONFIG_DEBUG_FS block right above its only usage to clear up
the warning.

Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/pm/amdgpu_pm.c