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/vgpu/fifo_vgpu.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'drivers/gpu/nvgpu/vgpu/fifo_vgpu.c') diff --git a/drivers/gpu/nvgpu/vgpu/fifo_vgpu.c b/drivers/gpu/nvgpu/vgpu/fifo_vgpu.c index efeeb8ee..c3669990 100644 --- a/drivers/gpu/nvgpu/vgpu/fifo_vgpu.c +++ b/drivers/gpu/nvgpu/vgpu/fifo_vgpu.c @@ -184,7 +184,7 @@ static int init_runlist(struct gk20a *g, struct fifo_gk20a *f) { struct fifo_runlist_info_gk20a *runlist; struct device *d = dev_from_gk20a(g); - s32 runlist_id = -1; + unsigned int runlist_id = -1; u32 i; u64 runlist_size; @@ -238,7 +238,8 @@ static int vgpu_init_fifo_setup_sw(struct gk20a *g) struct fifo_gk20a *f = &g->fifo; struct device *d = dev_from_gk20a(g); struct vgpu_priv_data *priv = vgpu_get_priv_data(g); - int chid, err = 0; + unsigned int chid; + int err = 0; gk20a_dbg_fn(""); @@ -486,7 +487,7 @@ static int vgpu_fifo_update_runlist_locked(struct gk20a *g, u32 runlist_id, /* valid channel, add/remove it from active list. Otherwise, keep active list untouched for suspend/resume. */ - if (hw_chid != ~0) { + if (hw_chid != (u32)~0) { if (add) { if (test_and_set_bit(hw_chid, runlist->active_channels) == 1) @@ -498,7 +499,7 @@ static int vgpu_fifo_update_runlist_locked(struct gk20a *g, u32 runlist_id, } } - if (hw_chid != ~0 || /* add/remove a valid channel */ + if (hw_chid != (u32)~0 || /* add/remove a valid channel */ add /* resume to add all channels back */) { u32 chid; -- cgit v1.2.2