From cdc7377df2f1c08c765d39eec5635995f2339971 Mon Sep 17 00:00:00 2001 From: Shiraz Hashim Date: Sun, 21 Feb 2016 12:45:34 +0530 Subject: [PATCH] arm: dma-mapping: fix data types to hold size_t size_t type data should not be held under variable of type int, as this can truncate large values especially on a 64bit system. Fix it. Change-Id: I5ad1ab321738772a99920e3fa287bda266cb05ed Signed-off-by: Shiraz Hashim Signed-off-by: Patrick Daly Signed-off-by: Charan Teja Reddy Signed-off-by: Vijayanand Jitta Signed-off-by: Qingqing Zhou --- arch/arm/mm/dma-mapping.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c index 7d1a39d51966..630260a325d7 100644 --- a/arch/arm/mm/dma-mapping.c +++ b/arch/arm/mm/dma-mapping.c @@ -1256,8 +1256,8 @@ static struct page **__iommu_alloc_buffer(struct device *dev, size_t size, int coherent_flag) { struct page **pages; - int count = size >> PAGE_SHIFT; - int array_size = count * sizeof(struct page *); + size_t count = size >> PAGE_SHIFT; + size_t array_size = count * sizeof(struct page *); int i = 0; int order_idx = 0;