From dd947aeec4d2b1c043202c87377d10b2e31311f9 Mon Sep 17 00:00:00 2001 From: Alex Waterman Date: Wed, 8 Mar 2017 11:21:30 -0800 Subject: gpu: nvgpu: Fix kmem function definition Use the correct type for the size argument in __nvgpu_kmalloc() and make sure the size_t type is available for usage. Bug 1799159 Bug 1823380 Change-Id: I7d6aea964e065e576c8bc3383a9b2326639c018f Signed-off-by: Alex Waterman Reviewed-on: http://git-master/r/1318308 Reviewed-by: svccoveritychecker GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom --- drivers/gpu/nvgpu/include/nvgpu/kmem.h | 16 ++++++++++------ drivers/gpu/nvgpu/include/nvgpu/kmem_linux.h | 2 +- 2 files changed, 11 insertions(+), 7 deletions(-) (limited to 'drivers/gpu/nvgpu') diff --git a/drivers/gpu/nvgpu/include/nvgpu/kmem.h b/drivers/gpu/nvgpu/include/nvgpu/kmem.h index 59192525..3159da8b 100644 --- a/drivers/gpu/nvgpu/include/nvgpu/kmem.h +++ b/drivers/gpu/nvgpu/include/nvgpu/kmem.h @@ -26,6 +26,16 @@ struct gk20a; +/* + * When there's other implementations make sure they are included instead of + * Linux when not compiling on Linux! + * + * Also note this is above any usage of size_t. At the moment we don't have a + * cross OS way of defining the necessary types used by these APIs. Eventually + * we will need a include to handle this. + */ +#include + /** * DOC: Kmem cache support * @@ -214,12 +224,6 @@ void nvgpu_kmem_fini(struct gk20a *g, int flags); #define NVGPU_KMEM_FINI_WARN (1 << 2) #define NVGPU_KMEM_FINI_BUG (1 << 3) -/* - * When there's other implementations make sure they are included instead of - * Linux when not compiling on Linux! - */ -#include - static inline void *__nvgpu_big_alloc(struct gk20a *g, size_t size, bool clear) { void *p; diff --git a/drivers/gpu/nvgpu/include/nvgpu/kmem_linux.h b/drivers/gpu/nvgpu/include/nvgpu/kmem_linux.h index d1cd27f3..dbafc0ce 100644 --- a/drivers/gpu/nvgpu/include/nvgpu/kmem_linux.h +++ b/drivers/gpu/nvgpu/include/nvgpu/kmem_linux.h @@ -52,7 +52,7 @@ static inline void nvgpu_kmem_debugfs_init(struct device *dev) * nvgpu. This should not be included directly - instead include . */ -static inline void *__nvgpu_kmalloc(struct gk20a *g, unsigned long size, +static inline void *__nvgpu_kmalloc(struct gk20a *g, size_t size, unsigned long ip) { #ifdef CONFIG_NVGPU_TRACK_MEM_USAGE -- cgit v1.2.2