All of lore.kernel.org
 help / color / mirror / Atom feed
From: Carlos Eduardo Gallo Filho <gcarlos@disroot.org>
To: dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org
Cc: alexander.deucher@amd.com, Xinhui.Pan@amd.com,
	andrealmeid@riseup.net,
	Carlos Eduardo Gallo Filho <gcarlos@disroot.org>,
	christian.koenig@amd.com
Subject: [PATCH v2] drm/amdgpu: Remove unused variable that holds a return value
Date: Sat, 25 Mar 2023 17:31:36 -0300	[thread overview]
Message-ID: <20230325203136.14401-1-gcarlos@disroot.org> (raw)

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


                 reply	other threads:[~2023-03-25 20:31 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230325203136.14401-1-gcarlos@disroot.org \
    --to=gcarlos@disroot.org \
    --cc=Xinhui.Pan@amd.com \
    --cc=alexander.deucher@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=andrealmeid@riseup.net \
    --cc=christian.koenig@amd.com \
    --cc=dri-devel@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.