diff options
author | Srirangan <smadhavan@nvidia.com> | 2018-09-04 06:46:20 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2018-09-05 23:38:33 -0400 |
commit | ef851272e5201f343c9b287a9eacfc25d4912276 (patch) | |
tree | 2c7f85f168258e8b8779dd3ef32f1b18621fa6a7 /drivers/gpu/nvgpu/clk/clk_vin.c | |
parent | 78b4ab269f5d733c8b540a6a75db1f390172cc29 (diff) |
gpu: nvgpu: clk: 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: I228f04adea809e1dd4e6826bf1a04f051a533102
Signed-off-by: Srirangan <smadhavan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1796831
Reviewed-by: svc-misra-checker <svc-misra-checker@nvidia.com>
GVS: Gerrit_Virtual_Submit
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/clk/clk_vin.c')
-rw-r--r-- | drivers/gpu/nvgpu/clk/clk_vin.c | 45 |
1 files changed, 30 insertions, 15 deletions
diff --git a/drivers/gpu/nvgpu/clk/clk_vin.c b/drivers/gpu/nvgpu/clk/clk_vin.c index d57522af..1c18b662 100644 --- a/drivers/gpu/nvgpu/clk/clk_vin.c +++ b/drivers/gpu/nvgpu/clk/clk_vin.c | |||
@@ -155,8 +155,9 @@ static u32 _clk_vin_devgrp_pmudata_instget(struct gk20a *g, | |||
155 | 155 | ||
156 | /*check whether pmuboardobjgrp has a valid boardobj in index*/ | 156 | /*check whether pmuboardobjgrp has a valid boardobj in index*/ |
157 | if (((u32)BIT(idx) & | 157 | if (((u32)BIT(idx) & |
158 | pgrp_set->hdr.data.super.obj_mask.super.data[0]) == 0) | 158 | pgrp_set->hdr.data.super.obj_mask.super.data[0]) == 0) { |
159 | return -EINVAL; | 159 | return -EINVAL; |
160 | } | ||
160 | 161 | ||
161 | *ppboardobjpmudata = (struct nv_pmu_boardobj *) | 162 | *ppboardobjpmudata = (struct nv_pmu_boardobj *) |
162 | &pgrp_set->objects[idx].data.board_obj; | 163 | &pgrp_set->objects[idx].data.board_obj; |
@@ -175,8 +176,9 @@ static u32 _clk_vin_devgrp_pmustatus_instget(struct gk20a *g, | |||
175 | 176 | ||
176 | /*check whether pmuboardobjgrp has a valid boardobj in index*/ | 177 | /*check whether pmuboardobjgrp has a valid boardobj in index*/ |
177 | if (((u32)BIT(idx) & | 178 | if (((u32)BIT(idx) & |
178 | pgrp_get_status->hdr.data.super.obj_mask.super.data[0]) == 0) | 179 | pgrp_get_status->hdr.data.super.obj_mask.super.data[0]) == 0) { |
179 | return -EINVAL; | 180 | return -EINVAL; |
181 | } | ||
180 | 182 | ||
181 | *ppboardobjpmustatus = (struct nv_pmu_boardobj_query *) | 183 | *ppboardobjpmustatus = (struct nv_pmu_boardobj_query *) |
182 | &pgrp_get_status->objects[idx].data.board_obj; | 184 | &pgrp_get_status->objects[idx].data.board_obj; |
@@ -219,8 +221,9 @@ u32 clk_vin_sw_setup(struct gk20a *g) | |||
219 | pboardobjgrp->pmustatusinstget = _clk_vin_devgrp_pmustatus_instget; | 221 | pboardobjgrp->pmustatusinstget = _clk_vin_devgrp_pmustatus_instget; |
220 | 222 | ||
221 | status = devinit_get_vin_device_table(g, &g->clk_pmu.avfs_vinobjs); | 223 | status = devinit_get_vin_device_table(g, &g->clk_pmu.avfs_vinobjs); |
222 | if (status) | 224 | if (status) { |
223 | goto done; | 225 | goto done; |
226 | } | ||
224 | 227 | ||
225 | /*update vin calibration to fuse */ | 228 | /*update vin calibration to fuse */ |
226 | g->ops.pmu_ver.clk.clk_avfs_get_vin_cal_data(g, pvinobjs, pvindev); | 229 | g->ops.pmu_ver.clk.clk_avfs_get_vin_cal_data(g, pvinobjs, pvindev); |
@@ -249,8 +252,9 @@ u32 clk_vin_pmu_setup(struct gk20a *g) | |||
249 | 252 | ||
250 | pboardobjgrp = &g->clk_pmu.avfs_vinobjs.super.super; | 253 | pboardobjgrp = &g->clk_pmu.avfs_vinobjs.super.super; |
251 | 254 | ||
252 | if (!pboardobjgrp->bconstructed) | 255 | if (!pboardobjgrp->bconstructed) { |
253 | return -EINVAL; | 256 | return -EINVAL; |
257 | } | ||
254 | 258 | ||
255 | status = pboardobjgrp->pmuinithandle(g, pboardobjgrp); | 259 | status = pboardobjgrp->pmuinithandle(g, pboardobjgrp); |
256 | 260 | ||
@@ -299,8 +303,9 @@ static u32 devinit_get_vin_device_table(struct gk20a *g, | |||
299 | NV_VIN_DESC_FLAGS0_DISABLE_CONTROL); | 303 | NV_VIN_DESC_FLAGS0_DISABLE_CONTROL); |
300 | cal_type = BIOS_GET_FIELD(vin_desc_table_header.flags0, | 304 | cal_type = BIOS_GET_FIELD(vin_desc_table_header.flags0, |
301 | NV_VIN_DESC_FLAGS0_VIN_CAL_TYPE); | 305 | NV_VIN_DESC_FLAGS0_VIN_CAL_TYPE); |
302 | if(!cal_type) | 306 | if (!cal_type) { |
303 | cal_type = CTRL_CLK_VIN_CAL_TYPE_V10; | 307 | cal_type = CTRL_CLK_VIN_CAL_TYPE_V10; |
308 | } | ||
304 | 309 | ||
305 | switch (cal_type) { | 310 | switch (cal_type) { |
306 | case CTRL_CLK_VIN_CAL_TYPE_V10: | 311 | case CTRL_CLK_VIN_CAL_TYPE_V10: |
@@ -333,8 +338,9 @@ static u32 devinit_get_vin_device_table(struct gk20a *g, | |||
333 | memcpy(&vin_desc_table_entry, vin_tbl_entry_ptr, | 338 | memcpy(&vin_desc_table_entry, vin_tbl_entry_ptr, |
334 | sizeof(struct vin_descriptor_entry_10)); | 339 | sizeof(struct vin_descriptor_entry_10)); |
335 | 340 | ||
336 | if (vin_desc_table_entry.vin_device_type == CTRL_CLK_VIN_TYPE_DISABLED) | 341 | if (vin_desc_table_entry.vin_device_type == CTRL_CLK_VIN_TYPE_DISABLED) { |
337 | continue; | 342 | continue; |
343 | } | ||
338 | 344 | ||
339 | vin_device_data.boardobj.type = | 345 | vin_device_data.boardobj.type = |
340 | (u8)vin_desc_table_entry.vin_device_type; | 346 | (u8)vin_desc_table_entry.vin_device_type; |
@@ -379,13 +385,15 @@ static u32 vin_device_construct_v10(struct gk20a *g, | |||
379 | struct vin_device_v10 *ptmpvin_device_v10 = (struct vin_device_v10 *)pargs; | 385 | struct vin_device_v10 *ptmpvin_device_v10 = (struct vin_device_v10 *)pargs; |
380 | u32 status = 0; | 386 | u32 status = 0; |
381 | 387 | ||
382 | if (BOARDOBJ_GET_TYPE(pargs) != CTRL_CLK_VIN_TYPE_V10) | 388 | if (BOARDOBJ_GET_TYPE(pargs) != CTRL_CLK_VIN_TYPE_V10) { |
383 | return -EINVAL; | 389 | return -EINVAL; |
390 | } | ||
384 | 391 | ||
385 | ptmpobj->type_mask |= BIT(CTRL_CLK_VIN_TYPE_V10); | 392 | ptmpobj->type_mask |= BIT(CTRL_CLK_VIN_TYPE_V10); |
386 | status = vin_device_construct_super(g, ppboardobj, size, pargs); | 393 | status = vin_device_construct_super(g, ppboardobj, size, pargs); |
387 | if (status) | 394 | if (status) { |
388 | return -EINVAL; | 395 | return -EINVAL; |
396 | } | ||
389 | 397 | ||
390 | pvin_device_v10 = (struct vin_device_v10 *)*ppboardobj; | 398 | pvin_device_v10 = (struct vin_device_v10 *)*ppboardobj; |
391 | 399 | ||
@@ -407,13 +415,15 @@ static u32 vin_device_construct_v20(struct gk20a *g, | |||
407 | struct vin_device_v20 *ptmpvin_device_v20 = (struct vin_device_v20 *)pargs; | 415 | struct vin_device_v20 *ptmpvin_device_v20 = (struct vin_device_v20 *)pargs; |
408 | u32 status = 0; | 416 | u32 status = 0; |
409 | 417 | ||
410 | if (BOARDOBJ_GET_TYPE(pargs) != CTRL_CLK_VIN_TYPE_V20) | 418 | if (BOARDOBJ_GET_TYPE(pargs) != CTRL_CLK_VIN_TYPE_V20) { |
411 | return -EINVAL; | 419 | return -EINVAL; |
420 | } | ||
412 | 421 | ||
413 | ptmpobj->type_mask |= BIT(CTRL_CLK_VIN_TYPE_V20); | 422 | ptmpobj->type_mask |= BIT(CTRL_CLK_VIN_TYPE_V20); |
414 | status = vin_device_construct_super(g, ppboardobj, size, pargs); | 423 | status = vin_device_construct_super(g, ppboardobj, size, pargs); |
415 | if (status) | 424 | if (status) { |
416 | return -EINVAL; | 425 | return -EINVAL; |
426 | } | ||
417 | 427 | ||
418 | pvin_device_v20 = (struct vin_device_v20 *)*ppboardobj; | 428 | pvin_device_v20 = (struct vin_device_v20 *)*ppboardobj; |
419 | 429 | ||
@@ -434,8 +444,9 @@ static u32 vin_device_construct_super(struct gk20a *g, | |||
434 | u32 status = 0; | 444 | u32 status = 0; |
435 | status = boardobj_construct_super(g, ppboardobj, size, pargs); | 445 | status = boardobj_construct_super(g, ppboardobj, size, pargs); |
436 | 446 | ||
437 | if (status) | 447 | if (status) { |
438 | return -EINVAL; | 448 | return -EINVAL; |
449 | } | ||
439 | 450 | ||
440 | pvin_device = (struct vin_device *)*ppboardobj; | 451 | pvin_device = (struct vin_device *)*ppboardobj; |
441 | 452 | ||
@@ -470,8 +481,9 @@ static struct vin_device *construct_vin_device(struct gk20a *g, void *pargs) | |||
470 | return NULL; | 481 | return NULL; |
471 | }; | 482 | }; |
472 | 483 | ||
473 | if (status) | 484 | if (status) { |
474 | return NULL; | 485 | return NULL; |
486 | } | ||
475 | 487 | ||
476 | nvgpu_log_info(g, " Done"); | 488 | nvgpu_log_info(g, " Done"); |
477 | 489 | ||
@@ -491,8 +503,9 @@ static u32 vin_device_init_pmudata_v10(struct gk20a *g, | |||
491 | nvgpu_log_info(g, " "); | 503 | nvgpu_log_info(g, " "); |
492 | 504 | ||
493 | status = vin_device_init_pmudata_super(g, board_obj_ptr, ppmudata); | 505 | status = vin_device_init_pmudata_super(g, board_obj_ptr, ppmudata); |
494 | if (status != 0) | 506 | if (status != 0) { |
495 | return status; | 507 | return status; |
508 | } | ||
496 | 509 | ||
497 | pvin_dev_v20 = (struct vin_device_v20 *)board_obj_ptr; | 510 | pvin_dev_v20 = (struct vin_device_v20 *)board_obj_ptr; |
498 | perf_pmu_data = (struct nv_pmu_clk_clk_vin_device_v10_boardobj_set *) | 511 | perf_pmu_data = (struct nv_pmu_clk_clk_vin_device_v10_boardobj_set *) |
@@ -517,8 +530,9 @@ static u32 vin_device_init_pmudata_v20(struct gk20a *g, | |||
517 | nvgpu_log_info(g, " "); | 530 | nvgpu_log_info(g, " "); |
518 | 531 | ||
519 | status = vin_device_init_pmudata_super(g, board_obj_ptr, ppmudata); | 532 | status = vin_device_init_pmudata_super(g, board_obj_ptr, ppmudata); |
520 | if (status != 0) | 533 | if (status != 0) { |
521 | return status; | 534 | return status; |
535 | } | ||
522 | 536 | ||
523 | pvin_dev_v20 = (struct vin_device_v20 *)board_obj_ptr; | 537 | pvin_dev_v20 = (struct vin_device_v20 *)board_obj_ptr; |
524 | perf_pmu_data = (struct nv_pmu_clk_clk_vin_device_v20_boardobj_set *) | 538 | perf_pmu_data = (struct nv_pmu_clk_clk_vin_device_v20_boardobj_set *) |
@@ -543,8 +557,9 @@ static u32 vin_device_init_pmudata_super(struct gk20a *g, | |||
543 | nvgpu_log_info(g, " "); | 557 | nvgpu_log_info(g, " "); |
544 | 558 | ||
545 | status = boardobj_pmudatainit_super(g, board_obj_ptr, ppmudata); | 559 | status = boardobj_pmudatainit_super(g, board_obj_ptr, ppmudata); |
546 | if (status != 0) | 560 | if (status != 0) { |
547 | return status; | 561 | return status; |
562 | } | ||
548 | 563 | ||
549 | pvin_dev = (struct vin_device *)board_obj_ptr; | 564 | pvin_dev = (struct vin_device *)board_obj_ptr; |
550 | perf_pmu_data = (struct nv_pmu_clk_clk_vin_device_boardobj_set *) | 565 | perf_pmu_data = (struct nv_pmu_clk_clk_vin_device_boardobj_set *) |