Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d0153c7f authored by Dave Martin's avatar Dave Martin Committed by Will Deacon
Browse files

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: default avatarMark Rutland <mark.rutland@arm.com>
Signed-off-by: default avatarDave Martin <Dave.Martin@arm.com>
[will: same change to write_sysreg_s]
Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
parent 6c17c1c3
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -492,7 +492,7 @@ asm(
 * the "%x0" template means XZR.
 */
#define write_sysreg(v, r) do {					\
	u64 __val = (u64)v;					\
	u64 __val = (u64)(v);					\
	asm volatile("msr " __stringify(r) ", %x0"		\
		     : : "rZ" (__val));				\
} while (0)
@@ -508,7 +508,7 @@ asm(
})

#define write_sysreg_s(v, r) do {					\
	u64 __val = (u64)v;						\
	u64 __val = (u64)(v);						\
	asm volatile("msr_s " __stringify(r) ", %x0" : : "rZ" (__val));	\
} while (0)