]> xenbits.xensource.com Git - xen.git/commitdiff
xen/arm: Surround HSR_SYSREG macro value with ()
authorJulien Grall <julien.grall@linaro.org>
Wed, 29 Nov 2017 17:46:35 +0000 (17:46 +0000)
committerStefano Stabellini <sstabellini@kernel.org>
Fri, 8 Dec 2017 21:15:41 +0000 (13:15 -0800)
The value of the macro HCR_SYSREG is not surrounded by (). This means
the behavior may change depend on how it is used.

Thanksfully recent GCC will issue a warning for that.

Signed-off-by: Julien Grall <julien.grall@linaro.org>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
xen/include/asm-arm/arm64/sysregs.h

index 084d2a1e5d4384487d0b2f62eb92780e2314d6af..1811234249650d32b17078de4c3c397ab5b13203 100644 (file)
 
 /* These are used to decode traps with HSR.EC==HSR_EC_SYSREG */
 #define HSR_SYSREG(op0,op1,crn,crm,op2) \
-    ((__HSR_SYSREG_##op0) << HSR_SYSREG_OP0_SHIFT) | \
-    ((__HSR_SYSREG_##op1) << HSR_SYSREG_OP1_SHIFT) | \
-    ((__HSR_SYSREG_##crn) << HSR_SYSREG_CRN_SHIFT) | \
-    ((__HSR_SYSREG_##crm) << HSR_SYSREG_CRM_SHIFT) | \
-    ((__HSR_SYSREG_##op2) << HSR_SYSREG_OP2_SHIFT)
+    (((__HSR_SYSREG_##op0) << HSR_SYSREG_OP0_SHIFT) | \
+     ((__HSR_SYSREG_##op1) << HSR_SYSREG_OP1_SHIFT) | \
+     ((__HSR_SYSREG_##crn) << HSR_SYSREG_CRN_SHIFT) | \
+     ((__HSR_SYSREG_##crm) << HSR_SYSREG_CRM_SHIFT) | \
+     ((__HSR_SYSREG_##op2) << HSR_SYSREG_OP2_SHIFT))
 
 #define HSR_SYSREG_DCISW          HSR_SYSREG(1,0,c7,c6,2)
 #define HSR_SYSREG_DCCSW          HSR_SYSREG(1,0,c7,c10,2)