* [patch 1/2] iommu/arm-smmu: fix a signedness bug
@ 2013-08-21 8:33 Dan Carpenter
2013-08-21 10:32 ` Will Deacon
0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2013-08-21 8:33 UTC (permalink / raw)
To: linux-arm-kernel
Unsigned char is never equal to -1.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
I can't compile this code.
diff --git a/drivers/iommu/arm-smmu.c b/drivers/iommu/arm-smmu.c
index f417e89e..7243af3 100644
--- a/drivers/iommu/arm-smmu.c
+++ b/drivers/iommu/arm-smmu.c
@@ -377,6 +377,7 @@ struct arm_smmu_cfg {
u32 cbar;
pgd_t *pgd;
};
+#define INVALID_IRPTNDX 0xff
#define ARM_SMMU_CB_ASID(cfg) ((cfg)->cbndx)
#define ARM_SMMU_CB_VMID(cfg) ((cfg)->cbndx + 1)
@@ -840,7 +841,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;
}
@@ -869,7 +870,7 @@ static void arm_smmu_destroy_domain_context(struct iommu_domain *domain)
writel_relaxed(0, cb_base + ARM_SMMU_CB_SCTLR);
arm_smmu_tlb_inv_context(root_cfg);
- 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);
}
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [patch 1/2] iommu/arm-smmu: fix a signedness bug
2013-08-21 8:33 [patch 1/2] iommu/arm-smmu: fix a signedness bug Dan Carpenter
@ 2013-08-21 10:32 ` Will Deacon
0 siblings, 0 replies; 2+ messages in thread
From: Will Deacon @ 2013-08-21 10:32 UTC (permalink / raw)
To: linux-arm-kernel
Hi Dan,
On Wed, Aug 21, 2013 at 09:33:30AM +0100, Dan Carpenter wrote:
> Unsigned char is never equal to -1.
D'oh! Thanks for the patches.
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> ---
> I can't compile this code.
I've compiled and tested both of them with an AArch32 MMU-500 model and they
work fine. I'll send this lot in Joerg's direction with the other patches I
currently have queued.
Cheers,
Will
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-08-21 10:32 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-21 8:33 [patch 1/2] iommu/arm-smmu: fix a signedness bug Dan Carpenter
2013-08-21 10:32 ` Will Deacon
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).