[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20220612064050.1175083-1-sunliming@kylinos.cn>
Date: Sun, 12 Jun 2022 14:40:50 +0800
From: sunliming <sunliming@...inos.cn>
To: Ramesh.Errabolu@....com, alexander.deucher@....com,
Felix.Kuehling@....com
Cc: linux-kernel@...r.kernel.org, amd-gfx@...ts.freedesktop.org,
sunliming@...inos.cn, kelulanainsley@...il.com,
kernel test robot <lkp@...el.com>
Subject: [PATCH] drm/amdkfd: Add missing #if defined(CONFIG_HSA_AMD_P2P)
The variable 'i' in function kfd_dev_create_p2p_links is only used in
codes that gaurded by '#if defined(CONFIG_HSA_AMD_P2P)' check. So adding
CONFIG_HSA_AMD_P2P #ifdef check around variable 'i' too.
Fixes the following w1 warning:
drivers/gpu/drm/amd/amdgpu/../amdkfd/kfd_topology.c:1542:11: warning: variable 'i' set but not used [-Wunused-but-set-variable]
Reported-by: kernel test robot <lkp@...el.com>
Signed-off-by: sunliming <sunliming@...inos.cn>
---
drivers/gpu/drm/amd/amdkfd/kfd_topology.c | 6 ++++--
1 file changed, 4 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..4bfce71f7fa9 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;
+ uint32_t k;
+#if defined(CONFIG_HSA_AMD_P2P)
+ uint32_t i = 0;
+#endif
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);
--
2.25.1
Powered by blists - more mailing lists