From d29afd2c9e990799b470bb95a97935cf5b5020db Mon Sep 17 00:00:00 2001 From: Terje Bergstrom Date: Wed, 9 Nov 2016 15:53:16 -0800 Subject: 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 Reviewed-on: http://git-master/r/1252068 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/gk20a/ce2_gk20a.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'drivers/gpu/nvgpu/gk20a/ce2_gk20a.c') diff --git a/drivers/gpu/nvgpu/gk20a/ce2_gk20a.c b/drivers/gpu/nvgpu/gk20a/ce2_gk20a.c index bfd183fb..235bc027 100644 --- a/drivers/gpu/nvgpu/gk20a/ce2_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/ce2_gk20a.c @@ -211,10 +211,10 @@ static void gk20a_ce_delete_gpu_context(struct gk20a_gpu_ctx *ce_ctx) kfree(ce_ctx); } -static inline int gk20a_ce_get_method_size(int request_operation) +static inline unsigned int gk20a_ce_get_method_size(int request_operation) { /* failure size */ - int methodsize = ~0; + unsigned int methodsize = UINT_MAX; if (request_operation & NVGPU_CE_PHYS_MODE_TRANSFER) methodsize = 10 * 2 * sizeof(u32); @@ -518,7 +518,7 @@ u32 gk20a_ce_create_context_with_cb(struct device *dev, ce_ctx->gpu_ctx_state = NVGPU_CE_GPU_CTX_ALLOCATED; end: - if (ctx_id == ~0) { + if (ctx_id == (u32)~0) { mutex_lock(&ce_app->app_mutex); gk20a_ce_delete_gpu_context(ce_ctx); mutex_unlock(&ce_app->app_mutex); -- cgit v1.2.2