diff options
author | Alex Waterman <alexw@nvidia.com> | 2017-03-08 14:21:30 -0500 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2017-03-22 21:37:04 -0400 |
commit | dd947aeec4d2b1c043202c87377d10b2e31311f9 (patch) | |
tree | f7316e2a5d26ced7f61332ca7ea60cff4c3354a4 /drivers/gpu/nvgpu/include/nvgpu | |
parent | 29d214774458051fa2836c83943b542856184821 (diff) |
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 <alexw@nvidia.com>
Reviewed-on: http://git-master/r/1318308
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/include/nvgpu')
-rw-r--r-- | drivers/gpu/nvgpu/include/nvgpu/kmem.h | 16 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/include/nvgpu/kmem_linux.h | 2 |
2 files changed, 11 insertions, 7 deletions
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 @@ | |||
26 | 26 | ||
27 | struct gk20a; | 27 | struct gk20a; |
28 | 28 | ||
29 | /* | ||
30 | * When there's other implementations make sure they are included instead of | ||
31 | * Linux when not compiling on Linux! | ||
32 | * | ||
33 | * Also note this is above any usage of size_t. At the moment we don't have a | ||
34 | * cross OS way of defining the necessary types used by these APIs. Eventually | ||
35 | * we will need a <nvgpu/types.h> include to handle this. | ||
36 | */ | ||
37 | #include <nvgpu/kmem_linux.h> | ||
38 | |||
29 | /** | 39 | /** |
30 | * DOC: Kmem cache support | 40 | * DOC: Kmem cache support |
31 | * | 41 | * |
@@ -214,12 +224,6 @@ void nvgpu_kmem_fini(struct gk20a *g, int flags); | |||
214 | #define NVGPU_KMEM_FINI_WARN (1 << 2) | 224 | #define NVGPU_KMEM_FINI_WARN (1 << 2) |
215 | #define NVGPU_KMEM_FINI_BUG (1 << 3) | 225 | #define NVGPU_KMEM_FINI_BUG (1 << 3) |
216 | 226 | ||
217 | /* | ||
218 | * When there's other implementations make sure they are included instead of | ||
219 | * Linux when not compiling on Linux! | ||
220 | */ | ||
221 | #include <nvgpu/kmem_linux.h> | ||
222 | |||
223 | static inline void *__nvgpu_big_alloc(struct gk20a *g, size_t size, bool clear) | 227 | static inline void *__nvgpu_big_alloc(struct gk20a *g, size_t size, bool clear) |
224 | { | 228 | { |
225 | void *p; | 229 | 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) | |||
52 | * nvgpu. This should not be included directly - instead include <nvgpu/kmem.h>. | 52 | * nvgpu. This should not be included directly - instead include <nvgpu/kmem.h>. |
53 | */ | 53 | */ |
54 | 54 | ||
55 | static inline void *__nvgpu_kmalloc(struct gk20a *g, unsigned long size, | 55 | static inline void *__nvgpu_kmalloc(struct gk20a *g, size_t size, |
56 | unsigned long ip) | 56 | unsigned long ip) |
57 | { | 57 | { |
58 | #ifdef CONFIG_NVGPU_TRACK_MEM_USAGE | 58 | #ifdef CONFIG_NVGPU_TRACK_MEM_USAGE |