summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/common/fifo/submit.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/nvgpu/common/fifo/submit.c')
-rw-r--r--drivers/gpu/nvgpu/common/fifo/submit.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/gpu/nvgpu/common/fifo/submit.c b/drivers/gpu/nvgpu/common/fifo/submit.c
index d034f2d3..7f2f677d 100644
--- a/drivers/gpu/nvgpu/common/fifo/submit.c
+++ b/drivers/gpu/nvgpu/common/fifo/submit.c
@@ -179,7 +179,7 @@ static void nvgpu_submit_append_priv_cmdbuf(struct channel_gk20a *c,
179 trace_gk20a_push_cmdbuf(g->name, 0, cmd->size, 0, 179 trace_gk20a_push_cmdbuf(g->name, 0, cmd->size, 0,
180 (u32 *)cmd->mem->cpu_va + cmd->off); 180 (u32 *)cmd->mem->cpu_va + cmd->off);
181 181
182 c->gpfifo.put = (c->gpfifo.put + 1) & (c->gpfifo.entry_num - 1); 182 c->gpfifo.put = (c->gpfifo.put + 1U) & (c->gpfifo.entry_num - 1U);
183} 183}
184 184
185static int nvgpu_submit_append_gpfifo_user_direct(struct channel_gk20a *c, 185static int nvgpu_submit_append_gpfifo_user_direct(struct channel_gk20a *c,
@@ -286,7 +286,7 @@ static int nvgpu_submit_append_gpfifo(struct channel_gk20a *c,
286 trace_write_pushbuffers(c, num_entries); 286 trace_write_pushbuffers(c, num_entries);
287 287
288 c->gpfifo.put = (c->gpfifo.put + num_entries) & 288 c->gpfifo.put = (c->gpfifo.put + num_entries) &
289 (c->gpfifo.entry_num - 1); 289 (c->gpfifo.entry_num - 1U);
290 290
291 return 0; 291 return 0;
292} 292}
@@ -307,7 +307,7 @@ static int nvgpu_submit_channel_gpfifo(struct channel_gk20a *c,
307 struct channel_gk20a_job *job = NULL; 307 struct channel_gk20a_job *job = NULL;
308 /* we might need two extra gpfifo entries - one for pre fence 308 /* we might need two extra gpfifo entries - one for pre fence
309 * and one for post fence. */ 309 * and one for post fence. */
310 const int extra_entries = 2; 310 const u32 extra_entries = 2U;
311 bool skip_buffer_refcounting = (flags & 311 bool skip_buffer_refcounting = (flags &
312 NVGPU_SUBMIT_FLAGS_SKIP_BUFFER_REFCOUNTING); 312 NVGPU_SUBMIT_FLAGS_SKIP_BUFFER_REFCOUNTING);
313 int err = 0; 313 int err = 0;
@@ -330,7 +330,7 @@ static int nvgpu_submit_channel_gpfifo(struct channel_gk20a *c,
330 * Kernel can insert gpfifo entries before and after user gpfifos. 330 * Kernel can insert gpfifo entries before and after user gpfifos.
331 * So, add extra_entries in user request. Also, HW with fifo size N 331 * So, add extra_entries in user request. Also, HW with fifo size N
332 * can accept only N-1 entreis and so the below condition */ 332 * can accept only N-1 entreis and so the below condition */
333 if (c->gpfifo.entry_num - 1 < num_entries + extra_entries) { 333 if (c->gpfifo.entry_num - 1U < num_entries + extra_entries) {
334 nvgpu_err(g, "not enough gpfifo space allocated"); 334 nvgpu_err(g, "not enough gpfifo space allocated");
335 return -ENOMEM; 335 return -ENOMEM;
336 } 336 }