From e69a00d3de113c9d257d8ce3dbff478984b7ad06 Mon Sep 17 00:00:00 2001 From: Cho KyongHo Date: Fri, 23 Nov 2018 17:29:38 +0900 Subject: [PATCH] [RAMEN9610-12171] android: ion: fix assigning long to int This fixes SEC_INVALID_ASSIGNMENT_WITH_UNSIGNED_VALUES Change-Id: I87124a4421b76cfb0e4060bb33c273f3cc879398 Signed-off-by: Cho KyongHo --- drivers/staging/android/ion/ion_carveout_heap.c | 2 +- drivers/staging/android/ion/ion_fdt_exynos.c | 2 +- drivers/staging/android/ion/ion_hpa_heap.c | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/staging/android/ion/ion_carveout_heap.c b/drivers/staging/android/ion/ion_carveout_heap.c index c8cbbeabeee9..d26a020df856 100644 --- a/drivers/staging/android/ion/ion_carveout_heap.c +++ b/drivers/staging/android/ion/ion_carveout_heap.c @@ -186,7 +186,7 @@ static void carveout_heap_query(struct ion_heap *heap, struct ion_carveout_heap *carveout_heap = container_of(heap, struct ion_carveout_heap, heap); - data->size = carveout_heap->size; + data->size = (__u32)carveout_heap->size; if (carveout_heap->secure) data->heap_flags |= ION_HEAPDATA_FLAGS_ALLOW_PROTECTION; if (carveout_heap->untouchable) diff --git a/drivers/staging/android/ion/ion_fdt_exynos.c b/drivers/staging/android/ion/ion_fdt_exynos.c index 2c946df5726b..0fe013df81ec 100644 --- a/drivers/staging/android/ion/ion_fdt_exynos.c +++ b/drivers/staging/android/ion/ion_fdt_exynos.c @@ -98,7 +98,7 @@ static int __init exynos_ion_reserved_mem_setup(struct reserved_mem *rmem) ion_reserved_mem[reserved_mem_count].base = rmem->base; ion_reserved_mem[reserved_mem_count].size = rmem->size; ion_reserved_mem[reserved_mem_count].heapname = heapname; - ion_reserved_mem[reserved_mem_count].alloc_align = alloc_align; + ion_reserved_mem[reserved_mem_count].alloc_align = (unsigned int)alloc_align; ion_reserved_mem[reserved_mem_count].protection_id = protection_id; ion_reserved_mem[reserved_mem_count].secure = secure; ion_reserved_mem[reserved_mem_count].untouchable = untch; diff --git a/drivers/staging/android/ion/ion_hpa_heap.c b/drivers/staging/android/ion/ion_hpa_heap.c index 3a2384de9328..4c548f5e65e6 100644 --- a/drivers/staging/android/ion/ion_hpa_heap.c +++ b/drivers/staging/android/ion/ion_hpa_heap.c @@ -55,7 +55,8 @@ static int ion_hpa_allocate(struct ion_heap *heap, unsigned long flags) { struct ion_hpa_heap *hpa_heap = to_hpa_heap(heap); - unsigned int count = ION_HPA_PAGE_COUNT((unsigned int)len, hpa_heap); + unsigned int count = + (unsigned int)ION_HPA_PAGE_COUNT((unsigned int)len, hpa_heap); bool zero = !(flags & ION_FLAG_NOZEROED); bool cacheflush = !(flags & ION_FLAG_CACHED) || ((flags & ION_FLAG_SYNC_FORCE) != 0); -- 2.20.1