diff options
author | Oded Gabbay <oded.gabbay@gmail.com> | 2019-09-03 11:33:55 +0300 |
---|---|---|
committer | Oded Gabbay <oded.gabbay@gmail.com> | 2019-09-05 14:55:28 +0300 |
commit | 6dc66f7c26f97396a570f84f6b3c3593a6de7f11 (patch) | |
tree | 70c1a5b4ad204710494fb3080d94a72931f9dcf5 | |
parent | 307eae93d5ce3316b4c728408283da957350b2a8 (diff) | |
download | linux-stable-6dc66f7c26f97396a570f84f6b3c3593a6de7f11.tar.gz linux-stable-6dc66f7c26f97396a570f84f6b3c3593a6de7f11.tar.bz2 linux-stable-6dc66f7c26f97396a570f84f6b3c3593a6de7f11.zip |
habanalabs: correctly cast variable to __le32
When using the macro le32_to_cpu(x), we need to correctly convert x to be
__le32 in case it is defined as u32 variable.
Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>
Reviewed-by: Tomer Tayar <ttayar@habana.ai>
-rw-r--r-- | drivers/misc/habanalabs/habanalabs.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/misc/habanalabs/habanalabs.h b/drivers/misc/habanalabs/habanalabs.h index c39e07d665c4..75862be53c60 100644 --- a/drivers/misc/habanalabs/habanalabs.h +++ b/drivers/misc/habanalabs/habanalabs.h @@ -1107,13 +1107,13 @@ void hl_wreg(struct hl_device *hdev, u32 reg, u32 val); mb(); \ (val) = *((u32 *) (uintptr_t) (addr)); \ if (mem_written_by_device) \ - (val) = le32_to_cpu(val); \ + (val) = le32_to_cpu(*(__le32 *) &(val)); \ if (cond) \ break; \ if (timeout_us && ktime_compare(ktime_get(), __timeout) > 0) { \ (val) = *((u32 *) (uintptr_t) (addr)); \ if (mem_written_by_device) \ - (val) = le32_to_cpu(val); \ + (val) = le32_to_cpu(*(__le32 *) &(val)); \ break; \ } \ if (sleep_us) \ |