summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomer Tayar <ttayar@habana.ai>2023-03-15 12:46:18 +0300
committerOded Gabbay <ogabbay@kernel.org>2023-03-20 18:35:34 +0300
commitdc934c183d43d30e49eacddc76b9882a7e3c1cde (patch)
tree1ba92c0dd6ed5cddebdebcd8e9b538aee55a4ca5
parent9669b96f275b4706aa6d9e46479c81983595f0ee (diff)
downloadlinux-dc934c183d43d30e49eacddc76b9882a7e3c1cde.tar.xz
accel/habanalabs: fix a maybe-uninitialized compilation warnings
Initialize 'index' in gaudi2_handle_qman_err() and 'offset' in gaudi2_get_nic_idle_status() to avoid "maybe-uninitialized" compilation warnings. Signed-off-by: Tomer Tayar <ttayar@habana.ai> Reviewed-by: Oded Gabbay <ogabbay@kernel.org> Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
-rw-r--r--drivers/accel/habanalabs/gaudi2/gaudi2.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/accel/habanalabs/gaudi2/gaudi2.c b/drivers/accel/habanalabs/gaudi2/gaudi2.c
index 9e4ef22c5fb2..40563e29be8d 100644
--- a/drivers/accel/habanalabs/gaudi2/gaudi2.c
+++ b/drivers/accel/habanalabs/gaudi2/gaudi2.c
@@ -6997,7 +6997,7 @@ static bool gaudi2_get_nic_idle_status(struct hl_device *hdev, u64 *mask_arr, u8
u32 qm_glbl_sts0, qm_glbl_sts1, qm_cgm_sts;
bool is_idle = true, is_eng_idle;
int engine_idx, i;
- u64 offset;
+ u64 offset = 0;
/* NIC, twelve macros in Full chip */
if (e && hdev->nic_ports_mask)
@@ -8349,7 +8349,7 @@ static int gaudi2_handle_qman_err(struct hl_device *hdev, u16 event_type, u64 *e
{
u32 qid_base, error_count = 0;
u64 qman_base;
- u8 index;
+ u8 index = 0;
switch (event_type) {
case GAUDI2_EVENT_TPC0_QM ... GAUDI2_EVENT_TPC5_QM: