* [PATCH 1/2] iommu/tegra: smmu: Cleanup with lesser nest
@ 2012-07-30 5:39 Hiroshi Doyu
[not found] ` <1343626759-20680-1-git-send-email-hdoyu-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
0 siblings, 1 reply; 3+ messages in thread
From: Hiroshi Doyu @ 2012-07-30 5:39 UTC (permalink / raw)
To: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA
Cc: linux-tegra-u79uwXL29TY76Z2rM5mHXA, Hiroshi Doyu
Small clean up with lesser nest for readability.
Signed-off-by: Hiroshi Doyu <hdoyu-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
---
drivers/iommu/tegra-smmu.c | 13 ++++++++-----
1 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/drivers/iommu/tegra-smmu.c b/drivers/iommu/tegra-smmu.c
index 4ba325a..2be5ac2 100644
--- a/drivers/iommu/tegra-smmu.c
+++ b/drivers/iommu/tegra-smmu.c
@@ -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;
}
--
1.7.5.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH 2/2] iommu/tegra: smmu: Fix error initial value at domain_init
[not found] ` <1343626759-20680-1-git-send-email-hdoyu-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
@ 2012-07-30 5:39 ` Hiroshi Doyu
2012-08-03 14:09 ` [PATCH 1/2] iommu/tegra: smmu: Cleanup with lesser nest Joerg Roedel
1 sibling, 0 replies; 3+ messages in thread
From: Hiroshi Doyu @ 2012-07-30 5:39 UTC (permalink / raw)
To: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA
Cc: linux-tegra-u79uwXL29TY76Z2rM5mHXA, Hiroshi Doyu
err initial value should be -EAGAIN. Otherwise 2nd iteration always
fails in the case as[0] is occupied.
Signed-off-by: Hiroshi Doyu <hdoyu-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
---
drivers/iommu/tegra-smmu.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/iommu/tegra-smmu.c b/drivers/iommu/tegra-smmu.c
index 2be5ac2..7c9174d 100644
--- a/drivers/iommu/tegra-smmu.c
+++ b/drivers/iommu/tegra-smmu.c
@@ -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;
--
1.7.5.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH 1/2] iommu/tegra: smmu: Cleanup with lesser nest
[not found] ` <1343626759-20680-1-git-send-email-hdoyu-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2012-07-30 5:39 ` [PATCH 2/2] iommu/tegra: smmu: Fix error initial value at domain_init Hiroshi Doyu
@ 2012-08-03 14:09 ` Joerg Roedel
1 sibling, 0 replies; 3+ messages in thread
From: Joerg Roedel @ 2012-08-03 14:09 UTC (permalink / raw)
To: Hiroshi Doyu
Cc: linux-tegra-u79uwXL29TY76Z2rM5mHXA,
iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA
On Mon, Jul 30, 2012 at 08:39:18AM +0300, Hiroshi Doyu wrote:
> Small clean up with lesser nest for readability.
>
> Signed-off-by: Hiroshi Doyu <hdoyu-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
Applied both to iommu/fixes, thanks Hiroshi.
--
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
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2012-08-03 14:09 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-07-30 5:39 [PATCH 1/2] iommu/tegra: smmu: Cleanup with lesser nest Hiroshi Doyu
[not found] ` <1343626759-20680-1-git-send-email-hdoyu-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2012-07-30 5:39 ` [PATCH 2/2] iommu/tegra: smmu: Fix error initial value at domain_init Hiroshi Doyu
2012-08-03 14:09 ` [PATCH 1/2] iommu/tegra: smmu: Cleanup with lesser nest Joerg Roedel
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.