From 1811650b54e3d988dfd6dc9ecb8c7d0e4986d8a1 Mon Sep 17 00:00:00 2001 From: Krishna Reddy Date: Wed, 18 Jul 2012 14:59:51 -0700 Subject: video: tegra: nvmap: Set PAGELIST_VMALLOC_MIN size correct page list array size greater than PAGE_SIZE should use vmalloc. Change-Id: Ic03668ba7ff716bfb3cc08aaef5f86214ee0a9df Signed-off-by: Krishna Reddy Reviewed-on: http://git-master/r/116875 Reviewed-by: Alex Waterman Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Hiroshi Doyu Tested-by: Hiroshi Doyu Reviewed-by: Yu-Huan Hsu (cherry picked from commit ddacaacd2a9fff10187e026eaa0d898694eeb95f) Reviewed-on: http://git-master/r/118194 --- drivers/video/tegra/nvmap/nvmap_handle.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/video/tegra/nvmap/nvmap_handle.c b/drivers/video/tegra/nvmap/nvmap_handle.c index 05046ed8ba79..f12c058042dc 100644 --- a/drivers/video/tegra/nvmap/nvmap_handle.c +++ b/drivers/video/tegra/nvmap/nvmap_handle.c @@ -3,7 +3,7 @@ * * Handle allocation and freeing routines for nvmap * - * Copyright (c) 2009-2012, NVIDIA Corporation. + * Copyright (c) 2009-2012, NVIDIA CORPORATION. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -56,7 +56,7 @@ * the kernel (i.e., not a carveout handle) includes its array of pages. to * preserve kmalloc space, if the array of pages exceeds PAGELIST_VMALLOC_MIN, * the array is allocated using vmalloc. */ -#define PAGELIST_VMALLOC_MIN (PAGE_SIZE * 2) +#define PAGELIST_VMALLOC_MIN (PAGE_SIZE) #ifdef CONFIG_NVMAP_PAGE_POOLS @@ -444,7 +444,7 @@ fail: static inline void *altalloc(size_t len) { - if (len >= PAGELIST_VMALLOC_MIN) + if (len > PAGELIST_VMALLOC_MIN) return vmalloc(len); else return kmalloc(len, GFP_KERNEL); @@ -455,7 +455,7 @@ static inline void altfree(void *ptr, size_t len) if (!ptr) return; - if (len >= PAGELIST_VMALLOC_MIN) + if (len > PAGELIST_VMALLOC_MIN) vfree(ptr); else kfree(ptr); -- cgit v1.2.3