summaryrefslogtreecommitdiff
path: root/drivers/iommu
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2013-08-21 09:33:30 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-10-13 18:14:27 -0700
commit5f854447d6119d0dc79680fe0c1ced324fe2e03b (patch)
treec2ccb5aac9a8aaa1d34a982d34a7ce79813cb549 /drivers/iommu
parentbbe7602997289ee415a7767150ef6b599d56cf4a (diff)
iommu/arm-smmu: fix a signedness bug
commit faea13b72dbdb77e4d6ad83344596486611708b0 upstream. Unsigned char is never equal to -1. Tested-by: Will Deacon <will.deacon@arm.com> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Will Deacon <will.deacon@arm.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/iommu')
-rw-r--r--drivers/iommu/arm-smmu.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/iommu/arm-smmu.c b/drivers/iommu/arm-smmu.c
index ebd0a4cff049..32b22ec5aad1 100644
--- a/drivers/iommu/arm-smmu.c
+++ b/drivers/iommu/arm-smmu.c
@@ -379,6 +379,7 @@ struct arm_smmu_cfg {
u32 cbar;
pgd_t *pgd;
};
+#define INVALID_IRPTNDX 0xff
struct arm_smmu_domain {
/*
@@ -830,7 +831,7 @@ static int arm_smmu_init_domain_context(struct iommu_domain *domain,
if (IS_ERR_VALUE(ret)) {
dev_err(smmu->dev, "failed to request context IRQ %d (%u)\n",
root_cfg->irptndx, irq);
- root_cfg->irptndx = -1;
+ root_cfg->irptndx = INVALID_IRPTNDX;
goto out_free_context;
}
@@ -855,7 +856,7 @@ static void arm_smmu_destroy_domain_context(struct iommu_domain *domain)
if (!smmu)
return;
- if (root_cfg->irptndx != -1) {
+ if (root_cfg->irptndx != INVALID_IRPTNDX) {
irq = smmu->irqs[smmu->num_global_irqs + root_cfg->irptndx];
free_irq(irq, domain);
}