diff options
author | Quentin Lambert <lambert.quentin@gmail.com> | 2015-02-06 12:59:53 +0300 |
---|---|---|
committer | Joerg Roedel <jroedel@suse.de> | 2015-03-03 16:13:20 +0300 |
commit | 2f119c7895af56ca26b8e94f4650145a4b1b0d12 (patch) | |
tree | c78e7a594d8ccaf516d6eeb7c20a1a3b4330640c /drivers/iommu/intel_irq_remapping.c | |
parent | c517d838eb7d07bbe9507871fab3931deccff539 (diff) | |
download | linux-2f119c7895af56ca26b8e94f4650145a4b1b0d12.tar.xz |
iommu/vt-d: Convert non-returned local variable to boolean when relevant
This patch was produced using Coccinelle. A simplified version of the
semantic patch is:
@r exists@
identifier f;
local idexpression u8 x;
identifier xname;
@@
f(...) {
...when any
(
x@xname = 1;
|
x@xname = 0;
)
...when any
}
@bad exists@
identifier r.f;
local idexpression u8 r.x
expression e1 != {0, 1}, e2;
@@
f(...) {
...when any
(
x = e1;
|
x + e2
)
...when any
}
@depends on !bad@
identifier r.f;
local idexpression u8 r.x;
identifier r.xname;
@@
f(...) {
...
++ bool xname;
- int xname;
<...
(
x =
- 1
+ true
|
x =
- -1
+ false
)
...>
}
Signed-off-by: Quentin Lambert <lambert.quentin@gmail.com>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
Diffstat (limited to 'drivers/iommu/intel_irq_remapping.c')
-rw-r--r-- | drivers/iommu/intel_irq_remapping.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/iommu/intel_irq_remapping.c b/drivers/iommu/intel_irq_remapping.c index 14de1ab223c8..6c25b3c5b729 100644 --- a/drivers/iommu/intel_irq_remapping.c +++ b/drivers/iommu/intel_irq_remapping.c @@ -631,7 +631,7 @@ static int __init intel_enable_irq_remapping(void) { struct dmar_drhd_unit *drhd; struct intel_iommu *iommu; - int setup = 0; + bool setup = false; int eim = 0; if (x2apic_supported()) { @@ -697,7 +697,7 @@ static int __init intel_enable_irq_remapping(void) */ for_each_iommu(iommu, drhd) { iommu_set_irq_remapping(iommu, eim); - setup = 1; + setup = true; } if (!setup) @@ -856,7 +856,7 @@ static int __init parse_ioapics_under_ir(void) { struct dmar_drhd_unit *drhd; struct intel_iommu *iommu; - int ir_supported = 0; + bool ir_supported = false; int ioapic_idx; for_each_iommu(iommu, drhd) @@ -864,7 +864,7 @@ static int __init parse_ioapics_under_ir(void) if (ir_parse_ioapic_hpet_scope(drhd->hdr, iommu)) return -1; - ir_supported = 1; + ir_supported = true; } if (!ir_supported) @@ -917,7 +917,7 @@ static void disable_irq_remapping(void) static int reenable_irq_remapping(int eim) { struct dmar_drhd_unit *drhd; - int setup = 0; + bool setup = false; struct intel_iommu *iommu = NULL; for_each_iommu(iommu, drhd) @@ -933,7 +933,7 @@ static int reenable_irq_remapping(int eim) /* Set up interrupt remapping for iommu.*/ iommu_set_irq_remapping(iommu, eim); - setup = 1; + setup = true; } if (!setup) |