bus: mhi: core: fix potential operator-precedence with BHI macros
authorJeffrey Hugo <jhugo@codeaurora.org>
Tue, 20 Oct 2020 20:29:45 +0000 (14:29 -0600)
committerManivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Wed, 18 Nov 2020 09:50:34 +0000 (15:20 +0530)
commit8ff3f7bdde45b32f9294fc87e4bd76f369178664
treeea55b778874e492d675b0660869b297e61fede54
parent9b627c25e70816a5e1dca940444b5029065b4d60
bus: mhi: core: fix potential operator-precedence with BHI macros

The BHI_MSMHWID and BHI_OEMPKHASH macros take a value 'n' which is
a BHI register index. If 'n' is an expression rather than a simple
value, there can be an operator precedence issue which can result
in the incorrect calculation of the register offset. Adding
parentheses around the macro parameter can prevent such issues.

Signed-off-by: Jeffrey Hugo <jhugo@codeaurora.org>
Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Reviewed-by: Hemant Kumar <hemantk@codeaurora.org>
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
drivers/bus/mhi/core/internal.h