Skip to contentSkip to conversation

habanalabs: remove set but not used variable 'ctx'

PATCH Applied YueHaibing 2 participants 2 messages Sep 28, 2019 – Sep 29, 2019 Char and misc drivers

lore
Share & tools
lore

YueHaibing

author
#0 lore raw

PATCH 1/1 habanalabs: remove set but not used variable 'ctx'

Fixes gcc '-Wunused-but-set-variable' warning:

drivers/misc/habanalabs/device.c: In function hpriv_release:
drivers/misc/habanalabs/device.c:45:17: warning: variable ctx set but not used [-Wunused-but-set-variable]

It is never used since commit eb7caf84b029 ("habanalabs:
maintain a list of file private data objects")

---
 drivers/misc/habanalabs/device.c | 2 --
 1 file changed, 2 deletions(-)
drivers/misc/habanalabs/device.c +0 -2
index 459fee7..2f5a4da 100644
@@ -42,12 +42,10 @@ static void hpriv_release(struct kref *ref)
 {
 	struct hl_fpriv *hpriv;
 	struct hl_device *hdev;
-	struct hl_ctx *ctx;
 
 	hpriv = container_of(ref, struct hl_fpriv, refcount);
 
 	hdev = hpriv->hdev;
-	ctx = hpriv->ctx;
 
 	put_pid(hpriv->taskpid);
 
Signature · 1 line
2.7.4
Reviewed-by on v1 1/1 Applied
#1 lore raw
Quoted 33 lines · YueHaibing

Fixes gcc '-Wunused-but-set-variable' warning:

drivers/misc/habanalabs/device.c: In function hpriv_release:
drivers/misc/habanalabs/device.c:45:17: warning: variable ctx set but not used [-Wunused-but-set-variable]

It is never used since commit eb7caf84b029 ("habanalabs:
maintain a list of file private data objects")

---
 drivers/misc/habanalabs/device.c | 2 --
 1 file changed, 2 deletions(-)
drivers/misc/habanalabs/device.c +0 -3
index 459fee7..2f5a4da 100644
@@ -42,12 +42,10 @@ static void hpriv_release(struct kref *ref)
 {
        struct hl_fpriv *hpriv;
        struct hl_device *hdev;
-       struct hl_ctx *ctx;
 
        hpriv = container_of(ref, struct hl_fpriv, refcount);
 
        hdev = hpriv->hdev;
-       ctx = hpriv->ctx;
 
        put_pid(hpriv->taskpid);
 
--
Quoted 3 lines

2.7.4

This patch is:

Applied to -next.
Thanks,
Oded