summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a/regops_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/regops_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/regops_gk20a.c')
-rw-r--r--drivers/gpu/nvgpu/gk20a/regops_gk20a.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/regops_gk20a.c b/drivers/gpu/nvgpu/gk20a/regops_gk20a.c
index 8b87b523..b0754070 100644
--- a/drivers/gpu/nvgpu/gk20a/regops_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/regops_gk20a.c
@@ -35,7 +35,7 @@ static int regop_bsearch_range_cmp(const void *pkey, const void *pelem)
35 if (key < prange->base) 35 if (key < prange->base)
36 return -1; 36 return -1;
37 else if (prange->base <= key && key < (prange->base + 37 else if (prange->base <= key && key < (prange->base +
38 (prange->count * 4))) 38 (prange->count * 4U)))
39 return 0; 39 return 0;
40 return 1; 40 return 1;
41} 41}
@@ -379,7 +379,8 @@ int exec_regops_gk20a(struct dbg_session_gk20a *dbg_s,
379 struct nvgpu_dbg_gpu_reg_op *ops, 379 struct nvgpu_dbg_gpu_reg_op *ops,
380 u64 num_ops) 380 u64 num_ops)
381{ 381{
382 int err = 0, i; 382 int err = 0;
383 unsigned int i;
383 struct channel_gk20a *ch = NULL; 384 struct channel_gk20a *ch = NULL;
384 struct gk20a *g = dbg_s->g; 385 struct gk20a *g = dbg_s->g;
385 /*struct gr_gk20a *gr = &g->gr;*/ 386 /*struct gr_gk20a *gr = &g->gr;*/
@@ -799,7 +800,8 @@ static int gk20a_apply_smpc_war(struct dbg_session_gk20a *dbg_s)
799 * it was already swapped out in/out once or not, etc. 800 * it was already swapped out in/out once or not, etc.
800 */ 801 */
801 struct nvgpu_dbg_gpu_reg_op ops[4]; 802 struct nvgpu_dbg_gpu_reg_op ops[4];
802 int i; 803 unsigned int i;
804
803 for (i = 0; i < ARRAY_SIZE(ops); i++) { 805 for (i = 0; i < ARRAY_SIZE(ops); i++) {
804 ops[i].op = REGOP(WRITE_32); 806 ops[i].op = REGOP(WRITE_32);
805 ops[i].type = REGOP(TYPE_GR_CTX); 807 ops[i].type = REGOP(TYPE_GR_CTX);