提交 d0153c7f 编写于 作者: D Dave Martin 提交者: Will Deacon

arm64: sysreg: Fix unprotected macro argmuent in write_sysreg

write_sysreg() may misparse the value argument because it is used
without parentheses to protect it.

This patch adds the ( ) in order to avoid any surprises.
Acked-by: NMark Rutland <mark.rutland@arm.com>
Signed-off-by: NDave Martin <Dave.Martin@arm.com>
[will: same change to write_sysreg_s]
Signed-off-by: NWill Deacon <will.deacon@arm.com>
上级 6c17c1c3
...@@ -492,7 +492,7 @@ asm( ...@@ -492,7 +492,7 @@ asm(
* the "%x0" template means XZR. * the "%x0" template means XZR.
*/ */
#define write_sysreg(v, r) do { \ #define write_sysreg(v, r) do { \
u64 __val = (u64)v; \ u64 __val = (u64)(v); \
asm volatile("msr " __stringify(r) ", %x0" \ asm volatile("msr " __stringify(r) ", %x0" \
: : "rZ" (__val)); \ : : "rZ" (__val)); \
} while (0) } while (0)
...@@ -508,7 +508,7 @@ asm( ...@@ -508,7 +508,7 @@ asm(
}) })
#define write_sysreg_s(v, r) do { \ #define write_sysreg_s(v, r) do { \
u64 __val = (u64)v; \ u64 __val = (u64)(v); \
asm volatile("msr_s " __stringify(r) ", %x0" : : "rZ" (__val)); \ asm volatile("msr_s " __stringify(r) ", %x0" : : "rZ" (__val)); \
} while (0) } while (0)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册