From 73a5b2750a09e5d18cd7a5dc6c18a04016a4f902 Mon Sep 17 00:00:00 2001 From: schowdary Date: Tue, 24 Jul 2012 18:03:47 +0530 Subject: iommu: tegra/gart: resolve compilation warning - Add compilation flag to treat warning as error - resolve label defined but not used error in smmu bug 949219 Change-Id: Ie6693cf21904008bbe927b27817a9cd02ed0d34f Signed-off-by: schowdary Reviewed-on: http://git-master/r/118025 Reviewed-by: Sanjay Singh Rawat Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Hiroshi Doyu Tested-by: Hiroshi Doyu Reviewed-by: Sachin Nikam --- drivers/iommu/Makefile | 2 ++ drivers/iommu/tegra-smmu.c | 19 +++++++++---------- 2 files changed, 11 insertions(+), 10 deletions(-) (limited to 'drivers/iommu') diff --git a/drivers/iommu/Makefile b/drivers/iommu/Makefile index 7ad7a3bc1242..ed59619d1af8 100644 --- a/drivers/iommu/Makefile +++ b/drivers/iommu/Makefile @@ -8,5 +8,7 @@ obj-$(CONFIG_IRQ_REMAP) += intr_remapping.o obj-$(CONFIG_OMAP_IOMMU) += omap-iommu.o obj-$(CONFIG_OMAP_IOVMM) += omap-iovmm.o obj-$(CONFIG_OMAP_IOMMU_DEBUG) += omap-iommu-debug.o +CFLAGS_tegra-gart.o = -Werror obj-$(CONFIG_TEGRA_IOMMU_GART) += tegra-gart.o +CFLAGS_tegra-smmu.o = -Werror obj-$(CONFIG_TEGRA_IOMMU_SMMU) += tegra-smmu.o diff --git a/drivers/iommu/tegra-smmu.c b/drivers/iommu/tegra-smmu.c index 7b5ef3ffb7d0..25bff5c02bb4 100644 --- a/drivers/iommu/tegra-smmu.c +++ b/drivers/iommu/tegra-smmu.c @@ -320,8 +320,15 @@ static int __smmu_client_set_hwgrp(struct smmu_client *c, val = smmu_read(smmu, offs); if (on) { #if !defined(SKIP_SWGRP_CHECK) - if (WARN_ON(val & mask)) - goto err_hw_busy; + if (WARN_ON(val & mask)) { + for_each_set_bit(i, &map, HWGRP_COUNT) { + offs = HWGRP_ASID_REG(i); + val = smmu_read(smmu, offs); + val &= ~mask; + smmu_write(smmu, val, offs); + } + return -EBUSY; + } #endif val |= mask; } else { @@ -336,14 +343,6 @@ static int __smmu_client_set_hwgrp(struct smmu_client *c, c->hwgrp = map; return 0; -err_hw_busy: - for_each_set_bit(i, &map, HWGRP_COUNT) { - offs = HWGRP_ASID_REG(i); - val = smmu_read(smmu, offs); - val &= ~mask; - smmu_write(smmu, val, offs); - } - return -EBUSY; } static int smmu_client_set_hwgrp(struct smmu_client *c, u32 map, int on) -- cgit v1.2.3