lkml.org 
[lkml]   [2022]   [Jun]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] drm/amdkfd: Add missing #if defined(CONFIG_HSA_AMD_P2P)
Date
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@intel.com>
Signed-off-by: sunliming <sunliming@kylinos.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
\
 
 \ /
  Last update: 2022-06-12 08:41    [W:0.030 / U:0.084 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site