summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a/regops_gk20a.c
diff options
context:
space:
mode:
authorScott Long <scottl@nvidia.com>2018-08-31 18:43:24 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2018-09-04 13:54:24 -0400
commita18f364fd28cf6a19edcb55b22a9b458d29a826d (patch)
tree863e2887e79cce82e6e475c68cb2817c82bd0e05 /drivers/gpu/nvgpu/gk20a/regops_gk20a.c
parentcf394f82d47901a0ea981e9229db5b51bc05a81a (diff)
gpu: nvgpu: fix various MISRA 10.1 bool violations
This patch corrects a handful of MISRA 10.1 violations involving illegal arithmetic operations (e.g. bitwise OR) on boolean values: * fix to status handling in regops validation code * fix to debugger event handling in gr code * fix to entries_left tracking in runlist construct code * fix to verbose channel dumping and reset tracking in fifo code JIRA NVGPU-650 Change-Id: I3c3d9123b5a0e08fc936d0e63d51de99fc310ade Signed-off-by: Scott Long <scottl@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1810957 Reviewed-by: svc-misra-checker <svc-misra-checker@nvidia.com> GVS: Gerrit_Virtual_Submit Reviewed-by: Alex Waterman <alexw@nvidia.com> Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com> 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.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/regops_gk20a.c b/drivers/gpu/nvgpu/gk20a/regops_gk20a.c
index cd3fe2f7..26ba944a 100644
--- a/drivers/gpu/nvgpu/gk20a/regops_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/regops_gk20a.c
@@ -404,7 +404,6 @@ static bool validate_reg_ops(struct dbg_session_gk20a *dbg_s,
404 u32 op_count) 404 u32 op_count)
405{ 405{
406 u32 i; 406 u32 i;
407 int err;
408 bool ok = true; 407 bool ok = true;
409 struct gk20a *g = dbg_s->g; 408 struct gk20a *g = dbg_s->g;
410 409
@@ -412,8 +411,9 @@ static bool validate_reg_ops(struct dbg_session_gk20a *dbg_s,
412 * a separate error code if needed */ 411 * a separate error code if needed */
413 for (i = 0; i < op_count; i++) { 412 for (i = 0; i < op_count; i++) {
414 413
415 err = validate_reg_op_info(dbg_s, &ops[i]); 414 if (validate_reg_op_info(dbg_s, &ops[i]) != 0) {
416 ok &= !err; 415 ok = false;
416 }
417 417
418 if (reg_op_is_gr_ctx(ops[i].type)) { 418 if (reg_op_is_gr_ctx(ops[i].type)) {
419 if (reg_op_is_read(ops[i].op)) 419 if (reg_op_is_read(ops[i].op))
@@ -424,8 +424,9 @@ static bool validate_reg_ops(struct dbg_session_gk20a *dbg_s,
424 424
425 /* if "allow_all" flag enabled, dont validate offset */ 425 /* if "allow_all" flag enabled, dont validate offset */
426 if (!g->allow_all) { 426 if (!g->allow_all) {
427 err = validate_reg_op_offset(dbg_s, &ops[i]); 427 if (validate_reg_op_offset(dbg_s, &ops[i]) != 0) {
428 ok &= !err; 428 ok = false;
429 }
429 } 430 }
430 } 431 }
431 432