Skip to content

Commit 5c08c5a

Browse files
John Garrywilldeacon
authored andcommitted
iommu/arm-smmu-v3: Remove some unneeded init in arm_smmu_cmdq_issue_cmdlist()
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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Will Deacon <[email protected]>
1 parent ff11764 commit 5c08c5a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -733,11 +733,11 @@ static int arm_smmu_cmdq_issue_cmdlist(struct arm_smmu_device *smmu,
733733
unsigned long flags;
734734
bool owner;
735735
struct arm_smmu_cmdq *cmdq = &smmu->cmdq;
736-
struct arm_smmu_ll_queue llq = {
737-
.max_n_shift = cmdq->q.llq.max_n_shift,
738-
}, head = llq;
736+
struct arm_smmu_ll_queue llq, head;
739737
int ret = 0;
740738

739+
llq.max_n_shift = cmdq->q.llq.max_n_shift;
740+
741741
/* 1. Allocate some space in the queue */
742742
local_irq_save(flags);
743743
llq.val = READ_ONCE(cmdq->q.llq.val);

0 commit comments

Comments
 (0)