Commit 6dc66f7c authored by Oded Gabbay's avatar Oded Gabbay

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: default avatarOded Gabbay <oded.gabbay@gmail.com>
Reviewed-by: default avatarTomer Tayar <ttayar@habana.ai>
parent 307eae93
...@@ -1107,13 +1107,13 @@ void hl_wreg(struct hl_device *hdev, u32 reg, u32 val); ...@@ -1107,13 +1107,13 @@ void hl_wreg(struct hl_device *hdev, u32 reg, u32 val);
mb(); \ mb(); \
(val) = *((u32 *) (uintptr_t) (addr)); \ (val) = *((u32 *) (uintptr_t) (addr)); \
if (mem_written_by_device) \ if (mem_written_by_device) \
(val) = le32_to_cpu(val); \ (val) = le32_to_cpu(*(__le32 *) &(val)); \
if (cond) \ if (cond) \
break; \ break; \
if (timeout_us && ktime_compare(ktime_get(), __timeout) > 0) { \ if (timeout_us && ktime_compare(ktime_get(), __timeout) > 0) { \
(val) = *((u32 *) (uintptr_t) (addr)); \ (val) = *((u32 *) (uintptr_t) (addr)); \
if (mem_written_by_device) \ if (mem_written_by_device) \
(val) = le32_to_cpu(val); \ (val) = le32_to_cpu(*(__le32 *) &(val)); \
break; \ break; \
} \ } \
if (sleep_us) \ if (sleep_us) \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment