Skip to content

Commit fb69634

Browse files
vlsunilavpatel
authored andcommitted
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 dd12af6 commit fb69634

File tree

1 file changed

+7
-6
lines changed
  • drivers/crypto/hisilicon

1 file changed

+7
-6
lines changed

drivers/crypto/hisilicon/qm.c

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -611,13 +611,9 @@ EXPORT_SYMBOL_GPL(hisi_qm_wait_mb_ready);
611611
static void qm_mb_write(struct hisi_qm *qm, const void *src)
612612
{
613613
void __iomem *fun_base = qm->io_base + QM_MB_CMD_SEND_BASE;
614-
unsigned long tmp0 = 0, tmp1 = 0;
615614

616-
if (!IS_ENABLED(CONFIG_ARM64)) {
617-
memcpy_toio(fun_base, src, 16);
618-
dma_wmb();
619-
return;
620-
}
615+
#if IS_ENABLED(CONFIG_ARM64)
616+
unsigned long tmp0 = 0, tmp1 = 0;
621617

622618
asm volatile("ldp %0, %1, %3\n"
623619
"stp %0, %1, %2\n"
@@ -627,6 +623,11 @@ static void qm_mb_write(struct hisi_qm *qm, const void *src)
627623
"+Q" (*((char __iomem *)fun_base))
628624
: "Q" (*((char *)src))
629625
: "memory");
626+
#else
627+
memcpy_toio(fun_base, src, 16);
628+
dma_wmb();
629+
#endif
630+
630631
}
631632

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

0 commit comments

Comments
 (0)