Hi,

On 28/07/2022 14:49, Xenia Ragiadakou wrote:
The macro parameter 'v' is used as an expression and needs to be enclosed in
parentheses.

Signed-off-by: Xenia Ragiadakou <[email protected]>
---
  xen/arch/arm/include/asm/arm64/sysregs.h | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/arm/include/asm/arm64/sysregs.h 
b/xen/arch/arm/include/asm/arm64/sysregs.h
index 54670084c3..f5a7269a27 100644
--- a/xen/arch/arm/include/asm/arm64/sysregs.h
+++ b/xen/arch/arm/include/asm/arm64/sysregs.h
@@ -461,7 +461,7 @@
  /* Access to system registers */
#define WRITE_SYSREG64(v, name) do { \
-    uint64_t _r = v;                                    \
+    uint64_t _r = (v);                                              \

I am failing to see why the parentheses are necessary here. Could you give an example where the lack of them would end up to different code?

      asm volatile("msr "__stringify(name)", %0" : : "r" (_r));       \
  } while (0)
  #define READ_SYSREG64(name) ({                          \

Cheers,

--
Julien Grall

Reply via email to