aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdkfd/kfd_topology.c
diff options
context:
space:
mode:
authorAlex Deucher <alexander.deucher@amd.com>2022-06-10 11:38:05 -0400
committerAlex Deucher <alexander.deucher@amd.com>2022-06-14 21:38:41 -0400
commit914da384ae9a77079314f07022c18063c7e77778 (patch)
treeb209c74469e7455c2356c9dfb35fc6f1453d8c0d /drivers/gpu/drm/amd/amdkfd/kfd_topology.c
parentdrm/amdgpu: remove redundant enable_mes and enable_mes_kiq (diff)
downloadlinux-dev-914da384ae9a77079314f07022c18063c7e77778.tar.xz
linux-dev-914da384ae9a77079314f07022c18063c7e77778.zip
drm/amdkfd: fix warning when CONFIG_HSA_AMD_P2P is not set
drivers/gpu/drm/amd/amdgpu/../amdkfd/kfd_topology.c:1542:11: warning: variable 'i' set but not used [-Wunused-but-set-variable] Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com> Acked-by: Christian König <christian.koenig@amd.com> Reported-by: kernel test robot <lkp@intel.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdkfd/kfd_topology.c')
-rw-r--r--drivers/gpu/drm/amd/amdkfd/kfd_topology.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_topology.c b/drivers/gpu/drm/amd/amdkfd/kfd_topology.c
index 304322ac39e6..25990bec600d 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_topology.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_topology.c
@@ -1539,7 +1539,10 @@ static int kfd_dev_create_p2p_links(void)
{
struct kfd_topology_device *dev;
struct kfd_topology_device *new_dev;
- uint32_t i, k;
+#if defined(CONFIG_HSA_AMD_P2P)
+ uint32_t i;
+#endif
+ uint32_t k;
int ret = 0;
k = 0;
@@ -1553,7 +1556,6 @@ static int kfd_dev_create_p2p_links(void)
return 0;
k--;
- i = 0;
/* create in-direct links */
ret = kfd_create_indirect_link_prop(new_dev, k);
@@ -1562,6 +1564,7 @@ static int kfd_dev_create_p2p_links(void)
/* create p2p links */
#if defined(CONFIG_HSA_AMD_P2P)
+ i = 0;
list_for_each_entry(dev, &topology_device_list, list) {
if (dev == new_dev)
break;