Skip to content

Commit a80554f

Browse files
Julien Thierryctmarinas
authored andcommitted
arm64: irqflags: Fix clang build warnings
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@gmail.com> Tested-by: Nathan Chancellor <natechancellor@gmail.com> Signed-off-by: Julien Thierry <julien.thierry@arm.com> Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
1 parent bc3c03c commit a80554f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

arch/arm64/include/asm/irqflags.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ static inline void arch_local_irq_enable(void)
4747
"dsb sy",
4848
ARM64_HAS_IRQ_PRIO_MASKING)
4949
:
50-
: "r" (GIC_PRIO_IRQON)
50+
: "r" ((unsigned long) GIC_PRIO_IRQON)
5151
: "memory");
5252
}
5353

@@ -58,7 +58,7 @@ static inline void arch_local_irq_disable(void)
5858
"msr_s " __stringify(SYS_ICC_PMR_EL1) ", %0",
5959
ARM64_HAS_IRQ_PRIO_MASKING)
6060
:
61-
: "r" (GIC_PRIO_IRQOFF)
61+
: "r" ((unsigned long) GIC_PRIO_IRQOFF)
6262
: "memory");
6363
}
6464

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

9797
return flags;

0 commit comments

Comments
 (0)