提交 20c588c5 编写于 作者: J Julien Thierry 提交者: Caspar Zhang

arm64: irqflags: Fix clang build warnings

task #25552995

commit a80554fc36ba41d96af8e72fb54cd5d490e06c54 upstream

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: NNathan Chancellor <natechancellor@gmail.com>
Tested-by: NNathan Chancellor <natechancellor@gmail.com>
Signed-off-by: NJulien Thierry <julien.thierry@arm.com>
Signed-off-by: NCatalin Marinas <catalin.marinas@arm.com>
Signed-off-by: NZou Cao <zoucao@linux.alibaba.com>
Reviewed-by: Nluanshi <zhangliguang@linux.alibaba.com>
上级 beaa4f75
...@@ -47,7 +47,7 @@ static inline void arch_local_irq_enable(void) ...@@ -47,7 +47,7 @@ static inline void arch_local_irq_enable(void)
"dsb sy", "dsb sy",
ARM64_HAS_IRQ_PRIO_MASKING) ARM64_HAS_IRQ_PRIO_MASKING)
: :
: "r" (GIC_PRIO_IRQON) : "r" ((unsigned long) GIC_PRIO_IRQON)
: "memory"); : "memory");
} }
...@@ -58,7 +58,7 @@ static inline void arch_local_irq_disable(void) ...@@ -58,7 +58,7 @@ static inline void arch_local_irq_disable(void)
"msr_s " __stringify(SYS_ICC_PMR_EL1) ", %0", "msr_s " __stringify(SYS_ICC_PMR_EL1) ", %0",
ARM64_HAS_IRQ_PRIO_MASKING) ARM64_HAS_IRQ_PRIO_MASKING)
: :
: "r" (GIC_PRIO_IRQOFF) : "r" ((unsigned long) GIC_PRIO_IRQOFF)
: "memory"); : "memory");
} }
...@@ -91,7 +91,7 @@ static inline unsigned long arch_local_save_flags(void) ...@@ -91,7 +91,7 @@ static inline unsigned long arch_local_save_flags(void)
"csel %0, %0, %2, eq", "csel %0, %0, %2, eq",
ARM64_HAS_IRQ_PRIO_MASKING) ARM64_HAS_IRQ_PRIO_MASKING)
: "=&r" (flags), "+r" (daif_bits) : "=&r" (flags), "+r" (daif_bits)
: "r" (GIC_PRIO_IRQOFF) : "r" ((unsigned long) GIC_PRIO_IRQOFF)
: "memory"); : "memory");
return flags; return flags;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册