diff mbox series

accel/habanalabs: fix gaudi2_get_tpc_idle_status() return

Message ID c8000ec5-18e9-4e25-aeb1-3a6ce467d5f6@kili.mountain (mailing list archive)
State New, archived
Headers show
Series accel/habanalabs: fix gaudi2_get_tpc_idle_status() return | expand

Commit Message

Dan Carpenter May 15, 2023, 10:32 a.m. UTC
The gaudi2_get_tpc_idle_status() function returned the incorrect variable
so it always returned true.

Fixes: d85f0531b928 ("accel/habanalabs: break is_idle function into per-engine sub-routines")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
---
From static analysis.  Not tested.

 drivers/accel/habanalabs/gaudi2/gaudi2.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Oded Gabbay May 16, 2023, 6:50 a.m. UTC | #1
On Mon, May 15, 2023 at 1:32 PM Dan Carpenter <dan.carpenter@linaro.org> wrote:
>
> The gaudi2_get_tpc_idle_status() function returned the incorrect variable
> so it always returned true.
>
> Fixes: d85f0531b928 ("accel/habanalabs: break is_idle function into per-engine sub-routines")
> Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
> ---
> From static analysis.  Not tested.
>
>  drivers/accel/habanalabs/gaudi2/gaudi2.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/accel/habanalabs/gaudi2/gaudi2.c b/drivers/accel/habanalabs/gaudi2/gaudi2.c
> index b778cf764a68..5539c84ee717 100644
> --- a/drivers/accel/habanalabs/gaudi2/gaudi2.c
> +++ b/drivers/accel/habanalabs/gaudi2/gaudi2.c
> @@ -7231,7 +7231,7 @@ static bool gaudi2_get_tpc_idle_status(struct hl_device *hdev, u64 *mask_arr, u8
>
>         gaudi2_iterate_tpcs(hdev, &tpc_iter);
>
> -       return tpc_idle_data.is_idle;
> +       return *tpc_idle_data.is_idle;
>  }
>
>  static bool gaudi2_get_decoder_idle_status(struct hl_device *hdev, u64 *mask_arr, u8 mask_len,
> --
> 2.39.2
>
Reviewed-by: Oded Gabbay <ogabbay@kernel.org>
Applied to -next.
Thanks,
Oded
diff mbox series

Patch

diff --git a/drivers/accel/habanalabs/gaudi2/gaudi2.c b/drivers/accel/habanalabs/gaudi2/gaudi2.c
index b778cf764a68..5539c84ee717 100644
--- a/drivers/accel/habanalabs/gaudi2/gaudi2.c
+++ b/drivers/accel/habanalabs/gaudi2/gaudi2.c
@@ -7231,7 +7231,7 @@  static bool gaudi2_get_tpc_idle_status(struct hl_device *hdev, u64 *mask_arr, u8
 
 	gaudi2_iterate_tpcs(hdev, &tpc_iter);
 
-	return tpc_idle_data.is_idle;
+	return *tpc_idle_data.is_idle;
 }
 
 static bool gaudi2_get_decoder_idle_status(struct hl_device *hdev, u64 *mask_arr, u8 mask_len,