summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a/mm_gk20a.c
diff options
context:
space:
mode:
authorTerje Bergstrom <tbergstrom@nvidia.com>2016-11-09 18:53:16 -0500
committermobile promotions <svcmobile_promotions@nvidia.com>2016-11-17 00:35:36 -0500
commitd29afd2c9e990799b470bb95a97935cf5b5020db (patch)
tree48f14dffe90956e9b42b02a87b95fd7a1dfeef3e /drivers/gpu/nvgpu/gk20a/mm_gk20a.c
parent5494e846c78dd0da74635905ead3abe45502375f (diff)
gpu: nvgpu: Fix signed comparison bugs
Fix small problems related to signed versus unsigned comparisons throughout the driver. Bump up the warning level to prevent such problems from occuring in future. Change-Id: I8ff5efb419f664e8a2aedadd6515ae4d18502ae0 Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com> Reviewed-on: http://git-master/r/1252068 Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/mm_gk20a.c')
-rw-r--r--drivers/gpu/nvgpu/gk20a/mm_gk20a.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/mm_gk20a.c b/drivers/gpu/nvgpu/gk20a/mm_gk20a.c
index 9906b77b..fcd5d664 100644
--- a/drivers/gpu/nvgpu/gk20a/mm_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/mm_gk20a.c
@@ -789,10 +789,10 @@ static void gk20a_remove_mm_ce_support(struct mm_gk20a *mm)
789 struct gk20a *g = gk20a_from_mm(mm); 789 struct gk20a *g = gk20a_from_mm(mm);
790 struct gk20a_platform *platform = gk20a_get_platform(g->dev); 790 struct gk20a_platform *platform = gk20a_get_platform(g->dev);
791 791
792 if (mm->vidmem.ce_ctx_id != ~0) 792 if (mm->vidmem.ce_ctx_id != (u32)~0)
793 gk20a_ce_delete_context(g->dev, mm->vidmem.ce_ctx_id); 793 gk20a_ce_delete_context(g->dev, mm->vidmem.ce_ctx_id);
794 794
795 mm->vidmem.ce_ctx_id = ~0; 795 mm->vidmem.ce_ctx_id = (u32)~0;
796 796
797 if (platform->has_ce) 797 if (platform->has_ce)
798 gk20a_vm_remove_support_nofree(&mm->ce.vm); 798 gk20a_vm_remove_support_nofree(&mm->ce.vm);
@@ -836,7 +836,7 @@ static int gk20a_vidmem_clear_all(struct gk20a *g)
836 u64 region2_base = 0; 836 u64 region2_base = 0;
837 int err = 0; 837 int err = 0;
838 838
839 if (mm->vidmem.ce_ctx_id == ~0) 839 if (mm->vidmem.ce_ctx_id == (u32)~0)
840 return -EINVAL; 840 return -EINVAL;
841 841
842 err = gk20a_ce_execute_ops(g->dev, 842 err = gk20a_ce_execute_ops(g->dev,
@@ -989,7 +989,7 @@ int gk20a_init_mm_setup_sw(struct gk20a *g)
989 989
990 gk20a_init_pramin(mm); 990 gk20a_init_pramin(mm);
991 991
992 mm->vidmem.ce_ctx_id = ~0; 992 mm->vidmem.ce_ctx_id = (u32)~0;
993 993
994 err = gk20a_init_vidmem(mm); 994 err = gk20a_init_vidmem(mm);
995 if (err) 995 if (err)
@@ -1119,7 +1119,7 @@ int gk20a_init_mm_support(struct gk20a *g)
1119void gk20a_init_mm_ce_context(struct gk20a *g) 1119void gk20a_init_mm_ce_context(struct gk20a *g)
1120{ 1120{
1121#if defined(CONFIG_GK20A_VIDMEM) 1121#if defined(CONFIG_GK20A_VIDMEM)
1122 if (g->mm.vidmem.size && (g->mm.vidmem.ce_ctx_id == ~0)) { 1122 if (g->mm.vidmem.size && (g->mm.vidmem.ce_ctx_id == (u32)~0)) {
1123 g->mm.vidmem.ce_ctx_id = 1123 g->mm.vidmem.ce_ctx_id =
1124 gk20a_ce_create_context_with_cb(g->dev, 1124 gk20a_ce_create_context_with_cb(g->dev,
1125 gk20a_fifo_get_fast_ce_runlist_id(g), 1125 gk20a_fifo_get_fast_ce_runlist_id(g),
@@ -1128,7 +1128,7 @@ void gk20a_init_mm_ce_context(struct gk20a *g)
1128 -1, 1128 -1,
1129 NULL); 1129 NULL);
1130 1130
1131 if (g->mm.vidmem.ce_ctx_id == ~0) 1131 if (g->mm.vidmem.ce_ctx_id == (u32)~0)
1132 gk20a_err(g->dev, 1132 gk20a_err(g->dev,
1133 "Failed to allocate CE context for vidmem page clearing support"); 1133 "Failed to allocate CE context for vidmem page clearing support");
1134 } 1134 }
@@ -3021,7 +3021,7 @@ static int gk20a_gmmu_clear_vidmem_mem(struct gk20a *g, struct mem_desc *mem)
3021 struct page_alloc_chunk *chunk = NULL; 3021 struct page_alloc_chunk *chunk = NULL;
3022 int err = 0; 3022 int err = 0;
3023 3023
3024 if (g->mm.vidmem.ce_ctx_id == ~0) 3024 if (g->mm.vidmem.ce_ctx_id == (u32)~0)
3025 return -EINVAL; 3025 return -EINVAL;
3026 3026
3027 alloc = get_vidmem_page_alloc(mem->sgt->sgl); 3027 alloc = get_vidmem_page_alloc(mem->sgt->sgl);