aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/iommu
diff options
context:
space:
mode:
authorQuentin Lambert <lambert.quentin@gmail.com>2015-02-04 05:40:07 -0500
committerJoerg Roedel <jroedel@suse.de>2015-02-04 10:26:39 -0500
commitae0cbbb1cde1f1bc2454a138a5cab1887d0e103c (patch)
treeebeb25eff4d2104904b3fce036cc4575f5338f9b /drivers/iommu
parenta1bec062c90456983225054d39c8a601db48e638 (diff)
iommu/amd: 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')
-rw-r--r--drivers/iommu/amd_iommu.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c
index 98024856df07..5ac2d118f4f4 100644
--- a/drivers/iommu/amd_iommu.c
+++ b/drivers/iommu/amd_iommu.c
@@ -843,10 +843,10 @@ static void build_inv_iommu_pages(struct iommu_cmd *cmd, u64 address,
843 size_t size, u16 domid, int pde) 843 size_t size, u16 domid, int pde)
844{ 844{
845 u64 pages; 845 u64 pages;
846 int s; 846 bool s;
847 847
848 pages = iommu_num_pages(address, size, PAGE_SIZE); 848 pages = iommu_num_pages(address, size, PAGE_SIZE);
849 s = 0; 849 s = false;
850 850
851 if (pages > 1) { 851 if (pages > 1) {
852 /* 852 /*
@@ -854,7 +854,7 @@ static void build_inv_iommu_pages(struct iommu_cmd *cmd, u64 address,
854 * TLB entries for this domain 854 * TLB entries for this domain
855 */ 855 */
856 address = CMD_INV_IOMMU_ALL_PAGES_ADDRESS; 856 address = CMD_INV_IOMMU_ALL_PAGES_ADDRESS;
857 s = 1; 857 s = true;
858 } 858 }
859 859
860 address &= PAGE_MASK; 860 address &= PAGE_MASK;
@@ -874,10 +874,10 @@ static void build_inv_iotlb_pages(struct iommu_cmd *cmd, u16 devid, int qdep,
874 u64 address, size_t size) 874 u64 address, size_t size)
875{ 875{
876 u64 pages; 876 u64 pages;
877 int s; 877 bool s;
878 878
879 pages = iommu_num_pages(address, size, PAGE_SIZE); 879 pages = iommu_num_pages(address, size, PAGE_SIZE);
880 s = 0; 880 s = false;
881 881
882 if (pages > 1) { 882 if (pages > 1) {
883 /* 883 /*
@@ -885,7 +885,7 @@ static void build_inv_iotlb_pages(struct iommu_cmd *cmd, u16 devid, int qdep,
885 * TLB entries for this domain 885 * TLB entries for this domain
886 */ 886 */
887 address = CMD_INV_IOMMU_ALL_PAGES_ADDRESS; 887 address = CMD_INV_IOMMU_ALL_PAGES_ADDRESS;
888 s = 1; 888 s = true;
889 } 889 }
890 890
891 address &= PAGE_MASK; 891 address &= PAGE_MASK;