[PATCH] arm64: irqflags: Fix clang build warnings

From: Julien Thierry
Date: Fri Feb 08 2019 - 04:21:58 EST


Clang complains when passing asm operands that are smaller than the
registers they are mapped to:

arch/arm64/include/asm/irqflags.h:50:10: warning: value size does not
match register size specified by the constraint and modifier
[-Wasm-operand-widths]
: "r" (GIC_PRIO_IRQON)

Fix it by casting the affected input operands to a type of the correct
size.

Reported-by: Nathan Chancellor <natechancellor@xxxxxxxxx>
Signed-off-by: Julien Thierry <julien.thierry@xxxxxxx>
---
arch/arm64/include/asm/irqflags.h | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/arm64/include/asm/irqflags.h b/arch/arm64/include/asm/irqflags.h
index d4597b2..43d8366 100644
--- a/arch/arm64/include/asm/irqflags.h
+++ b/arch/arm64/include/asm/irqflags.h
@@ -47,7 +47,7 @@ static inline void arch_local_irq_enable(void)
"dsb sy",
ARM64_HAS_IRQ_PRIO_MASKING)
:
- : "r" (GIC_PRIO_IRQON)
+ : "r" ((unsigned long) GIC_PRIO_IRQON)
: "memory");
}

@@ -58,7 +58,7 @@ static inline void arch_local_irq_disable(void)
"msr_s " __stringify(SYS_ICC_PMR_EL1) ", %0",
ARM64_HAS_IRQ_PRIO_MASKING)
:
- : "r" (GIC_PRIO_IRQOFF)
+ : "r" ((unsigned long) GIC_PRIO_IRQOFF)
: "memory");
}

@@ -91,7 +91,7 @@ static inline unsigned long arch_local_save_flags(void)
"csel %0, %0, %2, eq",
ARM64_HAS_IRQ_PRIO_MASKING)
: "=&r" (flags), "+r" (daif_bits)
- : "r" (GIC_PRIO_IRQOFF)
+ : "r" ((unsigned long) GIC_PRIO_IRQOFF)
: "memory");

return flags;
--
1.9.1