iommu/arm-smmu-v3: Properly handle the return value of arm_smmu_cmdq_build_cmd()
authorZhen Lei <thunder.leizhen@huawei.com>
Wed, 18 Aug 2021 08:04:51 +0000 (16:04 +0800)
committerWill Deacon <will@kernel.org>
Mon, 4 Oct 2021 11:21:13 +0000 (12:21 +0100)
commit59d9bd727495b13292dedee2c6c8c5d80de4d16f
tree36b658914ff2f5ba651f449a3778dc4a6d7b4a46
parent93f9f7958f12a1703799442011dd5f18db893c13
iommu/arm-smmu-v3: Properly handle the return value of arm_smmu_cmdq_build_cmd()

1. Build command CMD_SYNC cannot fail. So the return value can be ignored.
2. The arm_smmu_cmdq_build_cmd() almost never fails, the addition of
   "unlikely()" can optimize the instruction pipeline.
3. Check the return value in arm_smmu_cmdq_batch_add().

Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>
Link: https://lore.kernel.org/r/20210818080452.2079-2-thunder.leizhen@huawei.com
Signed-off-by: Will Deacon <will@kernel.org>
drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c