summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/include
diff options
context:
space:
mode:
authorSai Nikhil <snikhil@nvidia.com>2018-08-27 03:12:02 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2018-09-07 00:42:11 -0400
commit2dd9bb03dd56ca86b0e61b89fab38d38a58ecddf (patch)
treeb4de42f0056a65d1947c56f1f16afdcca29675a1 /drivers/gpu/nvgpu/include
parent7f8226887c28267d3c2351692d4429ead1e17695 (diff)
gpu: nvgpu: changing page_idx from int to u64
page_idx is an element of the struct nvgpu_semaphore_pool, defined in include/nvgpu/semaphore.h file. page_idx can not be negative so changing it from int to u64 and its related changes in various files. This also fixes MISRA 10.4 violations in these files. Jira NVGPU-992 Change-Id: Ie9696dab7da9e139bc31563783b422c84144f18b Signed-off-by: Sai Nikhil <snikhil@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1801632 Reviewed-by: Adeel Raza <araza@nvidia.com> GVS: Gerrit_Virtual_Submit Reviewed-by: Alex Waterman <alexw@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/include')
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/nvgpu_mem.h2
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/semaphore.h8
2 files changed, 5 insertions, 5 deletions
diff --git a/drivers/gpu/nvgpu/include/nvgpu/nvgpu_mem.h b/drivers/gpu/nvgpu/include/nvgpu/nvgpu_mem.h
index 32a7e388..2b8a5fd1 100644
--- a/drivers/gpu/nvgpu/include/nvgpu/nvgpu_mem.h
+++ b/drivers/gpu/nvgpu/include/nvgpu/nvgpu_mem.h
@@ -301,7 +301,7 @@ u64 nvgpu_sgt_alignment(struct gk20a *g, struct nvgpu_sgt *sgt);
301 */ 301 */
302int nvgpu_mem_create_from_mem(struct gk20a *g, 302int nvgpu_mem_create_from_mem(struct gk20a *g,
303 struct nvgpu_mem *dest, struct nvgpu_mem *src, 303 struct nvgpu_mem *dest, struct nvgpu_mem *src,
304 int start_page, int nr_pages); 304 u64 start_page, int nr_pages);
305 305
306/* 306/*
307 * Really free a vidmem buffer. There's a fair amount of work involved in 307 * Really free a vidmem buffer. There's a fair amount of work involved in
diff --git a/drivers/gpu/nvgpu/include/nvgpu/semaphore.h b/drivers/gpu/nvgpu/include/nvgpu/semaphore.h
index 85175069..3239551f 100644
--- a/drivers/gpu/nvgpu/include/nvgpu/semaphore.h
+++ b/drivers/gpu/nvgpu/include/nvgpu/semaphore.h
@@ -41,9 +41,9 @@
41 * Max number of channels that can be used is 512. This of course needs to be 41 * Max number of channels that can be used is 512. This of course needs to be
42 * fixed to be dynamic but still fast. 42 * fixed to be dynamic but still fast.
43 */ 43 */
44#define SEMAPHORE_POOL_COUNT 512 44#define SEMAPHORE_POOL_COUNT 512U
45#define SEMAPHORE_SIZE 16 45#define SEMAPHORE_SIZE 16U
46#define SEMAPHORE_SEA_GROWTH_RATE 32 46#define SEMAPHORE_SEA_GROWTH_RATE 32U
47 47
48struct nvgpu_semaphore_sea; 48struct nvgpu_semaphore_sea;
49 49
@@ -84,7 +84,7 @@ struct nvgpu_semaphore_pool {
84 struct nvgpu_list_node pool_list_entry; /* Node for list of pools. */ 84 struct nvgpu_list_node pool_list_entry; /* Node for list of pools. */
85 u64 gpu_va; /* GPU access to the pool. */ 85 u64 gpu_va; /* GPU access to the pool. */
86 u64 gpu_va_ro; /* GPU access to the pool. */ 86 u64 gpu_va_ro; /* GPU access to the pool. */
87 int page_idx; /* Index into sea bitmap. */ 87 u64 page_idx; /* Index into sea bitmap. */
88 88
89 DECLARE_BITMAP(semas_alloced, PAGE_SIZE / SEMAPHORE_SIZE); 89 DECLARE_BITMAP(semas_alloced, PAGE_SIZE / SEMAPHORE_SIZE);
90 90