* [PATCH v2] drm/amdgpu: Remove unused variable that holds a return value
@ 2023-03-25 20:31 Carlos Eduardo Gallo Filho
0 siblings, 0 replies; only message in thread
From: Carlos Eduardo Gallo Filho @ 2023-03-25 20:31 UTC (permalink / raw)
To: dri-devel, amd-gfx
Cc: alexander.deucher, Xinhui.Pan, andrealmeid,
Carlos Eduardo Gallo Filho, christian.koenig
Compiling amdgpu with W=1 get that unused-but-set-variable warning.
drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c: In function ‘amdgpu_mes_ctx_alloc_meta_data’:
drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c:1099:13: warning: variable ‘r’ set but not used [-Wunused-but-set-variable]
1099 | int r;
| ^
That variable is used to hold the return value of amdgpu_bo_create_kernel()
function call.
Remove r to fix the warning.
Signed-off-by: Carlos Eduardo Gallo Filho <gcarlos@disroot.org>
---
Changes in v2:
- Fix missing Signed-off-by tag
- Fix typo in the description
---
drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c | 14 ++++++--------
1 file changed, 6 insertions(+), 8 deletions(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c
index 82e27bd4f038..a45c31717ae3 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c
@@ -1096,14 +1096,12 @@ uint32_t amdgpu_mes_get_aggregated_doorbell_index(struct amdgpu_device *adev,
int amdgpu_mes_ctx_alloc_meta_data(struct amdgpu_device *adev,
struct amdgpu_mes_ctx_data *ctx_data)
{
- int r;
-
- r = amdgpu_bo_create_kernel(adev,
- sizeof(struct amdgpu_mes_ctx_meta_data),
- PAGE_SIZE, AMDGPU_GEM_DOMAIN_GTT,
- &ctx_data->meta_data_obj,
- &ctx_data->meta_data_mc_addr,
- &ctx_data->meta_data_ptr);
+ amdgpu_bo_create_kernel(adev,
+ sizeof(struct amdgpu_mes_ctx_meta_data),
+ PAGE_SIZE, AMDGPU_GEM_DOMAIN_GTT,
+ &ctx_data->meta_data_obj,
+ &ctx_data->meta_data_mc_addr,
+ &ctx_data->meta_data_ptr);
if (!ctx_data->meta_data_obj)
return -ENOMEM;
--
2.39.2
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2023-03-25 20:31 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-25 20:31 [PATCH v2] drm/amdgpu: Remove unused variable that holds a return value Carlos Eduardo Gallo Filho
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).