]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
iommu/arm-smmu-v3: Remove some unneeded init in arm_smmu_cmdq_issue_cmdlist()
authorJohn Garry <john.garry@huawei.com>
Mon, 21 Jun 2021 16:36:34 +0000 (00:36 +0800)
committerWill Deacon <will@kernel.org>
Mon, 2 Aug 2021 10:42:51 +0000 (11:42 +0100)
Members of struct "llq" will be zero-inited, apart from member max_n_shift.
But we write llq.val straight after the init, so it was pointless to zero
init those other members. As such, separately init member max_n_shift
only.

In addition, struct "head" is initialised to "llq" only so that member
max_n_shift is set. But that member is never referenced for "head", so
remove any init there.

Removing these initializations is seen as a small performance optimisation,
as this code is (very) hot path.

Signed-off-by: John Garry <john.garry@huawei.com>
Link: https://lore.kernel.org/r/1624293394-202509-1-git-send-email-john.garry@huawei.com
Signed-off-by: Will Deacon <will@kernel.org>
drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c

index 235f9bdaeaf223ba5086da2a00b40214426d5708..952291840c763b5f8d89a7a4d83b216d2adaf2d1 100644 (file)
@@ -733,11 +733,11 @@ static int arm_smmu_cmdq_issue_cmdlist(struct arm_smmu_device *smmu,
        unsigned long flags;
        bool owner;
        struct arm_smmu_cmdq *cmdq = &smmu->cmdq;
-       struct arm_smmu_ll_queue llq = {
-               .max_n_shift = cmdq->q.llq.max_n_shift,
-       }, head = llq;
+       struct arm_smmu_ll_queue llq, head;
        int ret = 0;
 
+       llq.max_n_shift = cmdq->q.llq.max_n_shift;
+
        /* 1. Allocate some space in the queue */
        local_irq_save(flags);
        llq.val = READ_ONCE(cmdq->q.llq.val);