iommu/tegra: smmu: Cleanup with lesser nest
Subsystems (3)
PATCH 1/2 iommu/tegra: smmu: Cleanup with lesser nest
Small clean up with lesser nest for readability.
Signed-off-by Hiroshi Doyu <[email protected]>
--- drivers/iommu/tegra-smmu.c | 13 ++++++++----- 1 files changed, 8 insertions(+), 5 deletions(-)
drivers/iommu/tegra-smmu.c +8 -5
@@ -814,11 +814,14 @@ static int smmu_iommu_domain_init(struct iommu_domain *domain)/* Look for a free AS with lock held */ for (i =0 ; i < smmu->num_as; i++) { as = &smmu->as[i]; -if (!as->pdir_page) { - err =alloc_pdir (as); -if (!err) - goto found; - } + +if (as->pdir_page) +continue ; + + err =alloc_pdir (as); +if (!err) + goto found; +if (err != -EAGAIN )break ; }
Signature · 1 line
1.7.5.4
A message that is not in the archive (sent off-list or not yet received): 1343626759-20680-1-git-send-email-hdoyu-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org
PATCH 2/2 iommu/tegra: smmu: Fix error initial value at domain_init
err initial value should be -EAGAIN. Otherwise 2nd iteration always fails in the case as[0] is occupied.
Signed-off-by Hiroshi Doyu <[email protected]>
--- drivers/iommu/tegra-smmu.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/iommu/tegra-smmu.c +1 -1
@@ -806,7 +806,7 @@ out:static int smmu_iommu_domain_init (struct iommu_domain *domain) { -int i, err = -ENODEV ; +int i, err = -EAGAIN ;unsigned long flags;struct smmu_as *as;struct smmu_device *smmu = smmu_handle;
Signature · 1 line
1.7.5.4
Joerg Roedel
AppliedQuoted 3 lines · Hiroshi Doyu
Small clean up with lesser nest for readability.
Signed-off-by Hiroshi Doyu <[email protected]>
Applied both to iommu/fixes, thanks Hiroshi.
Signature · 5 lines
AMD Operating System Research Center Advanced Micro Devices GmbH Einsteinring 24 85609 Dornach General Managers: Alberto Bozzo Registration: Dornach, Landkr. Muenchen; Registerger. Muenchen, HRB Nr. 43632