Skip to contentSkip to conversation

habanalabs: remove unused but set variable 'ctx_asid'

PATCH New Wei Yongjun 1 participant 1 message Jul 29, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 habanalabs: remove unused but set variable 'ctx_asid'

Gcc report warning as follows:

drivers/misc/habanalabs/common/command_submission.c:373:6: warning:
variable 'ctx_asid' set but not used [-Wunused-but-set-variable]

  373 |  int ctx_asid, rc;
      |      ^~~~~~~~

This variable is not used in function cs_timedout(), this commit remove it to fix the warning.

---
 .../misc/habanalabs/common/command_submission.c    | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/misc/habanalabs/common/command_submission.c +1 -2
index e096532c0e48..b9840e368eb5 100644
@@ -370,7 +370,7 @@ static void cs_do_release(struct kref *ref)
 static void cs_timedout(struct work_struct *work)
 {
 	struct hl_device *hdev;
-	int ctx_asid, rc;
+	int rc;
 	struct hl_cs *cs = container_of(work, struct hl_cs,
 						 work_tdr.work);
 	rc = cs_get_unless_zero(cs);
@@ -386,7 +386,6 @@ static void cs_timedout(struct work_struct *work)
 	cs->timedout = true;
 
 	hdev = cs->ctx->hdev;
-	ctx_asid = cs->ctx->asid;
 
 	dev_err(hdev->dev,
 		"Command submission %llu has not finished in time!\n",