Skip to content

Commit 4deaecc

Browse files
committed
crypto: hisilicon/qm: Fix to enable build with RISC-V clang
With CONFIG_ACPI enabled for RISC-V, this driver gets enabled in allmodconfig build. However, build fails with clang and below error is seen. drivers/crypto/hisilicon/qm.c:627:10: error: invalid output constraint '+Q' in asm "+Q" (*((char __iomem *)fun_base)) ^ This is expected error with clang due to the way it is designed. To fix this issue, move arm64 assembly code under #if. Link: ClangBuiltLinux#999 Signed-off-by: Nathan Chancellor <[email protected]> [[email protected]: Moved tmp0 and tmp1 into the #if] Signed-off-by: Sunil V L <[email protected]>
1 parent e4a7d80 commit 4deaecc

File tree

1 file changed

+5
-0
lines changed
  • drivers/crypto/hisilicon

1 file changed

+5
-0
lines changed

drivers/crypto/hisilicon/qm.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -610,14 +610,18 @@ EXPORT_SYMBOL_GPL(hisi_qm_wait_mb_ready);
610610
static void qm_mb_write(struct hisi_qm *qm, const void *src)
611611
{
612612
void __iomem *fun_base = qm->io_base + QM_MB_CMD_SEND_BASE;
613+
614+
#if IS_ENABLED(CONFIG_ARM64)
613615
unsigned long tmp0 = 0, tmp1 = 0;
616+
#endif
614617

615618
if (!IS_ENABLED(CONFIG_ARM64)) {
616619
memcpy_toio(fun_base, src, 16);
617620
dma_wmb();
618621
return;
619622
}
620623

624+
#if IS_ENABLED(CONFIG_ARM64)
621625
asm volatile("ldp %0, %1, %3\n"
622626
"stp %0, %1, %2\n"
623627
"dmb oshst\n"
@@ -626,6 +630,7 @@ static void qm_mb_write(struct hisi_qm *qm, const void *src)
626630
"+Q" (*((char __iomem *)fun_base))
627631
: "Q" (*((char *)src))
628632
: "memory");
633+
#endif
629634
}
630635

631636
static int qm_mb_nolock(struct hisi_qm *qm, struct qm_mailbox *mailbox)

0 commit comments

Comments
 (0)