summaryrefslogtreecommitdiffstats
path: root/drivers/iommu/mtk_iommu.c
diff options
context:
space:
mode:
authorAndrzej Hajda <a.hajda@samsung.com>2016-03-01 10:36:23 +0100
committerJoerg Roedel <jroedel@suse.de>2016-03-01 12:33:46 +0100
commit0b6c0ad3cfe6bc914af3ae595c9729e38f11a024 (patch)
tree5d2bed1e9d0fbe7d0c74140d70cd00c5f365ee54 /drivers/iommu/mtk_iommu.c
parentfd99f796a20b1a805c80ee51d7349d65103e7aaf (diff)
downloadlinux-0b6c0ad3cfe6bc914af3ae595c9729e38f11a024.tar.bz2
iommu/mediatek: Fix handling of of_count_phandle_with_args result
The function can return negative value so it should be assigned to signed variable. The patch changes also type of related i variable to make code more compact and coherent. The problem has been detected using patch scripts/coccinelle/tests/unsigned_lesser_than_zero.cocci. Signed-off-by: Andrzej Hajda <a.hajda@samsung.com> Signed-off-by: Joerg Roedel <jroedel@suse.de>
Diffstat (limited to 'drivers/iommu/mtk_iommu.c')
-rw-r--r--drivers/iommu/mtk_iommu.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/iommu/mtk_iommu.c b/drivers/iommu/mtk_iommu.c
index f3c160e4c25d..4b9ae64c2fc3 100644
--- a/drivers/iommu/mtk_iommu.c
+++ b/drivers/iommu/mtk_iommu.c
@@ -578,8 +578,7 @@ static int mtk_iommu_probe(struct platform_device *pdev)
struct resource *res;
struct component_match *match = NULL;
void *protect;
- unsigned int i, larb_nr;
- int ret;
+ int i, larb_nr, ret;
data = devm_kzalloc(dev, sizeof(*data), GFP_KERNEL);
if (!data)