]> git.baikalelectronics.ru Git - kernel.git/commitdiff
habanalabs/gaudi: fix warning: var might be used uninitialized
authorKoby Elbaz <kelbaz@habana.ai>
Wed, 22 Jun 2022 07:42:42 +0000 (10:42 +0300)
committerOded Gabbay <ogabbay@kernel.org>
Tue, 12 Jul 2022 06:09:24 +0000 (09:09 +0300)
kernel test robot:
"warning: variable 'index' is used uninitialized whenever 'if' condition
is false"

Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Koby Elbaz <kelbaz@habana.ai>
Reviewed-by: Oded Gabbay <ogabbay@kernel.org>
Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
drivers/misc/habanalabs/gaudi/gaudi.c

index 939d2636b9ed481aaedafda3f56a7b07159632b8..172c21f262e73bb0e706f28de0e138f0aa9a0b34 100644 (file)
@@ -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;
                }