Skip to content

Commit

Permalink
habanalabs: wrap macro arg with parentheses
Browse files Browse the repository at this point in the history
The macro argument <val> is cast-ed to u32 in some of the places.
Because this arg can be some arithmetic computation (e.g. address +
offset) the cast should be on the whole expression.

Signed-off-by: Ohad Sharabi <[email protected]>
Reviewed-by: Oded Gabbay <[email protected]>
Signed-off-by: Oded Gabbay <[email protected]>
  • Loading branch information
osharabi authored and ogabbay committed Sep 18, 2022
1 parent f25a72b commit 0c819c9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/misc/habanalabs/common/habanalabs.h
Original file line number Diff line number Diff line change
Expand Up @@ -2506,7 +2506,7 @@ void hl_wreg(struct hl_device *hdev, u32 reg, u32 val);
break; \
(val) = __elbi_read; \
} else {\
(val) = RREG32((u32)addr); \
(val) = RREG32((u32)(addr)); \
} \
if (cond) \
break; \
Expand All @@ -2517,7 +2517,7 @@ void hl_wreg(struct hl_device *hdev, u32 reg, u32 val);
break; \
(val) = __elbi_read; \
} else {\
(val) = RREG32((u32)addr); \
(val) = RREG32((u32)(addr)); \
} \
break; \
} \
Expand Down

0 comments on commit 0c819c9

Please sign in to comment.