Skip to content

Commit 131dbdd

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 175ea34 commit 131dbdd

File tree

1 file changed

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

1 file changed

+5
-1
lines changed

drivers/crypto/hisilicon/qm.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -610,14 +610,16 @@ 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-
unsigned long tmp0 = 0, tmp1 = 0;
614613

615614
if (!IS_ENABLED(CONFIG_ARM64)) {
616615
memcpy_toio(fun_base, src, 16);
617616
dma_wmb();
618617
return;
619618
}
620619

620+
#if IS_ENABLED(CONFIG_ARM64)
621+
unsigned long tmp0 = 0, tmp1 = 0;
622+
621623
asm volatile("ldp %0, %1, %3\n"
622624
"stp %0, %1, %2\n"
623625
"dmb oshst\n"
@@ -626,6 +628,8 @@ static void qm_mb_write(struct hisi_qm *qm, const void *src)
626628
"+Q" (*((char __iomem *)fun_base))
627629
: "Q" (*((char *)src))
628630
: "memory");
631+
#endif
632+
629633
}
630634

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

0 commit comments

Comments
 (0)