diff options
author | smadhavan <smadhavan@nvidia.com> | 2018-09-06 04:38:00 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2018-09-12 08:36:04 -0400 |
commit | c7a3b6db10900e0aabc29ca7307908875d685036 (patch) | |
tree | 1ee88207c5149344841b1423d0cb920498f844b0 /drivers/gpu/nvgpu/perf/vfe_equ.c | |
parent | c615002d22b4675d08404eb7cc7087d4418eccdb (diff) |
gpu: nvgpu: Fix MISRA 15.6 violations
MISRA Rule-15.6 requires that all if-else blocks be enclosed in braces,
including single statement blocks. Fix errors due to single statement
if blocks without braces by introducing the braces.
JIRA NVGPU-671
Change-Id: I8046a09fa7ffc74c3d737ba57132a0a9ae2ff195
Signed-off-by: smadhavan <smadhavan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1797699
Reviewed-by: svc-misra-checker <svc-misra-checker@nvidia.com>
Reviewed-by: Nitin Kumbhar <nkumbhar@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Konsta Holtta <kholtta@nvidia.com>
Reviewed-by: Vijayakumar Subbu <vsubbu@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/perf/vfe_equ.c')
-rw-r--r-- | drivers/gpu/nvgpu/perf/vfe_equ.c | 53 |
1 files changed, 34 insertions, 19 deletions
diff --git a/drivers/gpu/nvgpu/perf/vfe_equ.c b/drivers/gpu/nvgpu/perf/vfe_equ.c index fdeee9a7..8b308f37 100644 --- a/drivers/gpu/nvgpu/perf/vfe_equ.c +++ b/drivers/gpu/nvgpu/perf/vfe_equ.c | |||
@@ -62,8 +62,9 @@ static int _vfe_equs_pmudata_instget(struct gk20a *g, | |||
62 | nvgpu_log_info(g, " "); | 62 | nvgpu_log_info(g, " "); |
63 | 63 | ||
64 | /* check whether pmuboardobjgrp has a valid boardobj in index */ | 64 | /* check whether pmuboardobjgrp has a valid boardobj in index */ |
65 | if (idx >= CTRL_BOARDOBJGRP_E255_MAX_OBJECTS) | 65 | if (idx >= CTRL_BOARDOBJGRP_E255_MAX_OBJECTS) { |
66 | return -EINVAL; | 66 | return -EINVAL; |
67 | } | ||
67 | 68 | ||
68 | *ppboardobjpmudata = (struct nv_pmu_boardobj *) | 69 | *ppboardobjpmudata = (struct nv_pmu_boardobj *) |
69 | &pgrp_set->objects[idx].data.board_obj; | 70 | &pgrp_set->objects[idx].data.board_obj; |
@@ -105,8 +106,9 @@ int vfe_equ_sw_setup(struct gk20a *g) | |||
105 | pboardobjgrp->pmudatainstget = _vfe_equs_pmudata_instget; | 106 | pboardobjgrp->pmudatainstget = _vfe_equs_pmudata_instget; |
106 | 107 | ||
107 | status = devinit_get_vfe_equ_table(g, pvfeequobjs); | 108 | status = devinit_get_vfe_equ_table(g, pvfeequobjs); |
108 | if (status) | 109 | if (status) { |
109 | goto done; | 110 | goto done; |
111 | } | ||
110 | 112 | ||
111 | done: | 113 | done: |
112 | nvgpu_log_info(g, " done status %x", status); | 114 | nvgpu_log_info(g, " done status %x", status); |
@@ -122,8 +124,9 @@ int vfe_equ_pmu_setup(struct gk20a *g) | |||
122 | 124 | ||
123 | pboardobjgrp = &g->perf_pmu.vfe_equobjs.super.super; | 125 | pboardobjgrp = &g->perf_pmu.vfe_equobjs.super.super; |
124 | 126 | ||
125 | if (!pboardobjgrp->bconstructed) | 127 | if (!pboardobjgrp->bconstructed) { |
126 | return -EINVAL; | 128 | return -EINVAL; |
129 | } | ||
127 | 130 | ||
128 | status = pboardobjgrp->pmuinithandle(g, pboardobjgrp); | 131 | status = pboardobjgrp->pmuinithandle(g, pboardobjgrp); |
129 | 132 | ||
@@ -171,12 +174,12 @@ static int devinit_get_vfe_equ_table(struct gk20a *g, | |||
171 | } | 174 | } |
172 | 175 | ||
173 | if (vfeequs_tbl_header.vfe_equ_entry_size == | 176 | if (vfeequs_tbl_header.vfe_equ_entry_size == |
174 | VBIOS_VFE_3X_EQU_ENTRY_SIZE_17) | 177 | VBIOS_VFE_3X_EQU_ENTRY_SIZE_17) { |
175 | szfmt = VBIOS_VFE_3X_EQU_ENTRY_SIZE_17; | 178 | szfmt = VBIOS_VFE_3X_EQU_ENTRY_SIZE_17; |
176 | else if (vfeequs_tbl_header.vfe_equ_entry_size == | 179 | } else if (vfeequs_tbl_header.vfe_equ_entry_size == |
177 | VBIOS_VFE_3X_EQU_ENTRY_SIZE_18) | 180 | VBIOS_VFE_3X_EQU_ENTRY_SIZE_18) { |
178 | szfmt = VBIOS_VFE_3X_EQU_ENTRY_SIZE_18; | 181 | szfmt = VBIOS_VFE_3X_EQU_ENTRY_SIZE_18; |
179 | else { | 182 | } else { |
180 | status = -EINVAL; | 183 | status = -EINVAL; |
181 | goto done; | 184 | goto done; |
182 | } | 185 | } |
@@ -340,8 +343,9 @@ static int _vfe_equ_pmudatainit_super(struct gk20a *g, | |||
340 | nvgpu_log_info(g, " "); | 343 | nvgpu_log_info(g, " "); |
341 | 344 | ||
342 | status = boardobj_pmudatainit_super(g, board_obj_ptr, ppmudata); | 345 | status = boardobj_pmudatainit_super(g, board_obj_ptr, ppmudata); |
343 | if (status != 0) | 346 | if (status != 0) { |
344 | return status; | 347 | return status; |
348 | } | ||
345 | 349 | ||
346 | pvfe_equ = (struct vfe_equ *)board_obj_ptr; | 350 | pvfe_equ = (struct vfe_equ *)board_obj_ptr; |
347 | 351 | ||
@@ -367,8 +371,9 @@ static int vfe_equ_construct_super(struct gk20a *g, | |||
367 | 371 | ||
368 | status = boardobj_construct_super(g, ppboardobj, | 372 | status = boardobj_construct_super(g, ppboardobj, |
369 | size, pargs); | 373 | size, pargs); |
370 | if (status) | 374 | if (status) { |
371 | return -EINVAL; | 375 | return -EINVAL; |
376 | } | ||
372 | 377 | ||
373 | pvfeequ = (struct vfe_equ *)*ppboardobj; | 378 | pvfeequ = (struct vfe_equ *)*ppboardobj; |
374 | 379 | ||
@@ -395,8 +400,9 @@ static int _vfe_equ_pmudatainit_compare(struct gk20a *g, | |||
395 | nvgpu_log_info(g, " "); | 400 | nvgpu_log_info(g, " "); |
396 | 401 | ||
397 | status = _vfe_equ_pmudatainit_super(g, board_obj_ptr, ppmudata); | 402 | status = _vfe_equ_pmudatainit_super(g, board_obj_ptr, ppmudata); |
398 | if (status != 0) | 403 | if (status != 0) { |
399 | return status; | 404 | return status; |
405 | } | ||
400 | 406 | ||
401 | pvfe_equ_compare = (struct vfe_equ_compare *)board_obj_ptr; | 407 | pvfe_equ_compare = (struct vfe_equ_compare *)board_obj_ptr; |
402 | 408 | ||
@@ -421,13 +427,15 @@ static int vfe_equ_construct_compare(struct gk20a *g, | |||
421 | (struct vfe_equ_compare *)pargs; | 427 | (struct vfe_equ_compare *)pargs; |
422 | int status = 0; | 428 | int status = 0; |
423 | 429 | ||
424 | if (BOARDOBJ_GET_TYPE(pargs) != CTRL_PERF_VFE_EQU_TYPE_COMPARE) | 430 | if (BOARDOBJ_GET_TYPE(pargs) != CTRL_PERF_VFE_EQU_TYPE_COMPARE) { |
425 | return -EINVAL; | 431 | return -EINVAL; |
432 | } | ||
426 | 433 | ||
427 | ptmpobj->type_mask |= BIT(CTRL_PERF_VFE_EQU_TYPE_COMPARE); | 434 | ptmpobj->type_mask |= BIT(CTRL_PERF_VFE_EQU_TYPE_COMPARE); |
428 | status = vfe_equ_construct_super(g, ppboardobj, size, pargs); | 435 | status = vfe_equ_construct_super(g, ppboardobj, size, pargs); |
429 | if (status) | 436 | if (status) { |
430 | return -EINVAL; | 437 | return -EINVAL; |
438 | } | ||
431 | 439 | ||
432 | pvfeequ = (struct vfe_equ_compare *)*ppboardobj; | 440 | pvfeequ = (struct vfe_equ_compare *)*ppboardobj; |
433 | 441 | ||
@@ -454,8 +462,9 @@ static int _vfe_equ_pmudatainit_minmax(struct gk20a *g, | |||
454 | nvgpu_log_info(g, " "); | 462 | nvgpu_log_info(g, " "); |
455 | 463 | ||
456 | status = _vfe_equ_pmudatainit_super(g, board_obj_ptr, ppmudata); | 464 | status = _vfe_equ_pmudatainit_super(g, board_obj_ptr, ppmudata); |
457 | if (status != 0) | 465 | if (status != 0) { |
458 | return status; | 466 | return status; |
467 | } | ||
459 | 468 | ||
460 | pvfe_equ_minmax = (struct vfe_equ_minmax *)board_obj_ptr; | 469 | pvfe_equ_minmax = (struct vfe_equ_minmax *)board_obj_ptr; |
461 | 470 | ||
@@ -479,13 +488,15 @@ static int vfe_equ_construct_minmax(struct gk20a *g, | |||
479 | (struct vfe_equ_minmax *)pargs; | 488 | (struct vfe_equ_minmax *)pargs; |
480 | int status = 0; | 489 | int status = 0; |
481 | 490 | ||
482 | if (BOARDOBJ_GET_TYPE(pargs) != CTRL_PERF_VFE_EQU_TYPE_MINMAX) | 491 | if (BOARDOBJ_GET_TYPE(pargs) != CTRL_PERF_VFE_EQU_TYPE_MINMAX) { |
483 | return -EINVAL; | 492 | return -EINVAL; |
493 | } | ||
484 | 494 | ||
485 | ptmpobj->type_mask |= BIT(CTRL_PERF_VFE_EQU_TYPE_MINMAX); | 495 | ptmpobj->type_mask |= BIT(CTRL_PERF_VFE_EQU_TYPE_MINMAX); |
486 | status = vfe_equ_construct_super(g, ppboardobj, size, pargs); | 496 | status = vfe_equ_construct_super(g, ppboardobj, size, pargs); |
487 | if (status) | 497 | if (status) { |
488 | return -EINVAL; | 498 | return -EINVAL; |
499 | } | ||
489 | 500 | ||
490 | pvfeequ = (struct vfe_equ_minmax *)*ppboardobj; | 501 | pvfeequ = (struct vfe_equ_minmax *)*ppboardobj; |
491 | 502 | ||
@@ -510,8 +521,9 @@ static int _vfe_equ_pmudatainit_quadratic(struct gk20a *g, | |||
510 | nvgpu_log_info(g, " "); | 521 | nvgpu_log_info(g, " "); |
511 | 522 | ||
512 | status = _vfe_equ_pmudatainit_super(g, board_obj_ptr, ppmudata); | 523 | status = _vfe_equ_pmudatainit_super(g, board_obj_ptr, ppmudata); |
513 | if (status != 0) | 524 | if (status != 0) { |
514 | return status; | 525 | return status; |
526 | } | ||
515 | 527 | ||
516 | pvfe_equ_quadratic = (struct vfe_equ_quadratic *)board_obj_ptr; | 528 | pvfe_equ_quadratic = (struct vfe_equ_quadratic *)board_obj_ptr; |
517 | 529 | ||
@@ -535,13 +547,15 @@ static int vfe_equ_construct_quadratic(struct gk20a *g, | |||
535 | int status = 0; | 547 | int status = 0; |
536 | u32 i; | 548 | u32 i; |
537 | 549 | ||
538 | if (BOARDOBJ_GET_TYPE(pargs) != CTRL_PERF_VFE_EQU_TYPE_QUADRATIC) | 550 | if (BOARDOBJ_GET_TYPE(pargs) != CTRL_PERF_VFE_EQU_TYPE_QUADRATIC) { |
539 | return -EINVAL; | 551 | return -EINVAL; |
552 | } | ||
540 | 553 | ||
541 | ptmpobj->type_mask |= BIT(CTRL_PERF_VFE_EQU_TYPE_QUADRATIC); | 554 | ptmpobj->type_mask |= BIT(CTRL_PERF_VFE_EQU_TYPE_QUADRATIC); |
542 | status = vfe_equ_construct_super(g, ppboardobj, size, pargs); | 555 | status = vfe_equ_construct_super(g, ppboardobj, size, pargs); |
543 | if (status) | 556 | if (status) { |
544 | return -EINVAL; | 557 | return -EINVAL; |
558 | } | ||
545 | 559 | ||
546 | pvfeequ = (struct vfe_equ_quadratic *)*ppboardobj; | 560 | pvfeequ = (struct vfe_equ_quadratic *)*ppboardobj; |
547 | 561 | ||
@@ -583,8 +597,9 @@ static struct vfe_equ *construct_vfe_equ(struct gk20a *g, void *pargs) | |||
583 | 597 | ||
584 | } | 598 | } |
585 | 599 | ||
586 | if (status) | 600 | if (status) { |
587 | return NULL; | 601 | return NULL; |
602 | } | ||
588 | 603 | ||
589 | nvgpu_log_info(g, " Done"); | 604 | nvgpu_log_info(g, " Done"); |
590 | 605 | ||