[PATCH 2/9] habanalabs/gaudi: fix warning: var might be used uninitialized
From: Oded Gabbay
Date: Thu Jun 23 2022 - 16:42:29 EST
From: Koby Elbaz <kelbaz@xxxxxxxxx>
kernel test robot:
"warning: variable 'index' is used uninitialized whenever 'if' condition
is false"
Reported-by: kernel test robot <lkp@xxxxxxxxx>
Signed-off-by: Koby Elbaz <kelbaz@xxxxxxxxx>
Reviewed-by: Oded Gabbay <ogabbay@xxxxxxxxxx>
Signed-off-by: Oded Gabbay <ogabbay@xxxxxxxxxx>
---
drivers/misc/habanalabs/gaudi/gaudi.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/misc/habanalabs/gaudi/gaudi.c b/drivers/misc/habanalabs/gaudi/gaudi.c
index 939d2636b9ed..172c21f262e7 100644
--- a/drivers/misc/habanalabs/gaudi/gaudi.c
+++ b/drivers/misc/habanalabs/gaudi/gaudi.c
@@ -7388,7 +7388,7 @@ static void gaudi_handle_qman_err(struct hl_device *hdev, u16 event_type, u64 *e
if (event_type == GAUDI_EVENT_MME0_QM) {
index = 0;
qid_base = GAUDI_QUEUE_ID_MME_0_0;
- } else if (event_type == GAUDI_EVENT_MME2_QM) {
+ } else { /* event_type == GAUDI_EVENT_MME2_QM */
index = 2;
qid_base = GAUDI_QUEUE_ID_MME_1_0;
}
--
2.25.1