diff options
author | Philip Elcan <pelcan@nvidia.com> | 2018-08-29 15:46:12 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2018-09-07 00:33:50 -0400 |
commit | 7f8226887c28267d3c2351692d4429ead1e17695 (patch) | |
tree | aa09c45e496b058044c9d9a94c94d9922c572285 /drivers/gpu/nvgpu/perf | |
parent | 0e58ebaae13dd59b6aba5297f898e7c89fcd2742 (diff) |
gpu: nvgpu: cleanup return types for MISRA 10.3
This is a big cleanup of return types across a number of modules in the
nvgpu driver. Many functions were returning u32 but using negative
return codes. This is a MISRA 10.3 violation by assigning signed values
to a u32.
JIRA NVGPU-647
Change-Id: I59ee66706321f5b5b1a07ed8c24b81583e9ba28c
Signed-off-by: Philip Elcan <pelcan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1810743
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/perf')
-rw-r--r-- | drivers/gpu/nvgpu/perf/vfe_equ.c | 52 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/perf/vfe_equ.h | 6 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/perf/vfe_var.c | 88 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/perf/vfe_var.h | 4 |
4 files changed, 75 insertions, 75 deletions
diff --git a/drivers/gpu/nvgpu/perf/vfe_equ.c b/drivers/gpu/nvgpu/perf/vfe_equ.c index fa742c35..fdeee9a7 100644 --- a/drivers/gpu/nvgpu/perf/vfe_equ.c +++ b/drivers/gpu/nvgpu/perf/vfe_equ.c | |||
@@ -31,14 +31,14 @@ | |||
31 | #include "ctrl/ctrlvolt.h" | 31 | #include "ctrl/ctrlvolt.h" |
32 | 32 | ||
33 | static struct vfe_equ *construct_vfe_equ(struct gk20a *g, void *pargs); | 33 | static struct vfe_equ *construct_vfe_equ(struct gk20a *g, void *pargs); |
34 | static u32 devinit_get_vfe_equ_table(struct gk20a *g, | 34 | static int devinit_get_vfe_equ_table(struct gk20a *g, |
35 | struct vfe_equs *pequobjs); | 35 | struct vfe_equs *pequobjs); |
36 | 36 | ||
37 | static u32 _vfe_equs_pmudatainit(struct gk20a *g, | 37 | static int _vfe_equs_pmudatainit(struct gk20a *g, |
38 | struct boardobjgrp *pboardobjgrp, | 38 | struct boardobjgrp *pboardobjgrp, |
39 | struct nv_pmu_boardobjgrp_super *pboardobjgrppmu) | 39 | struct nv_pmu_boardobjgrp_super *pboardobjgrppmu) |
40 | { | 40 | { |
41 | u32 status = 0; | 41 | int status = 0; |
42 | 42 | ||
43 | status = boardobjgrp_pmudatainit_e255(g, pboardobjgrp, pboardobjgrppmu); | 43 | status = boardobjgrp_pmudatainit_e255(g, pboardobjgrp, pboardobjgrppmu); |
44 | if (status) { | 44 | if (status) { |
@@ -51,7 +51,7 @@ done: | |||
51 | return status; | 51 | return status; |
52 | } | 52 | } |
53 | 53 | ||
54 | static u32 _vfe_equs_pmudata_instget(struct gk20a *g, | 54 | static int _vfe_equs_pmudata_instget(struct gk20a *g, |
55 | struct nv_pmu_boardobjgrp *pmuboardobjgrp, | 55 | struct nv_pmu_boardobjgrp *pmuboardobjgrp, |
56 | struct nv_pmu_boardobj **ppboardobjpmudata, | 56 | struct nv_pmu_boardobj **ppboardobjpmudata, |
57 | u8 idx) | 57 | u8 idx) |
@@ -71,9 +71,9 @@ static u32 _vfe_equs_pmudata_instget(struct gk20a *g, | |||
71 | return 0; | 71 | return 0; |
72 | } | 72 | } |
73 | 73 | ||
74 | u32 vfe_equ_sw_setup(struct gk20a *g) | 74 | int vfe_equ_sw_setup(struct gk20a *g) |
75 | { | 75 | { |
76 | u32 status; | 76 | int status; |
77 | struct boardobjgrp *pboardobjgrp = NULL; | 77 | struct boardobjgrp *pboardobjgrp = NULL; |
78 | struct vfe_equs *pvfeequobjs; | 78 | struct vfe_equs *pvfeequobjs; |
79 | 79 | ||
@@ -113,9 +113,9 @@ done: | |||
113 | return status; | 113 | return status; |
114 | } | 114 | } |
115 | 115 | ||
116 | u32 vfe_equ_pmu_setup(struct gk20a *g) | 116 | int vfe_equ_pmu_setup(struct gk20a *g) |
117 | { | 117 | { |
118 | u32 status; | 118 | int status; |
119 | struct boardobjgrp *pboardobjgrp = NULL; | 119 | struct boardobjgrp *pboardobjgrp = NULL; |
120 | 120 | ||
121 | nvgpu_log_info(g, " "); | 121 | nvgpu_log_info(g, " "); |
@@ -131,10 +131,10 @@ u32 vfe_equ_pmu_setup(struct gk20a *g) | |||
131 | return status; | 131 | return status; |
132 | } | 132 | } |
133 | 133 | ||
134 | static u32 devinit_get_vfe_equ_table(struct gk20a *g, | 134 | static int devinit_get_vfe_equ_table(struct gk20a *g, |
135 | struct vfe_equs *pvfeequobjs) | 135 | struct vfe_equs *pvfeequobjs) |
136 | { | 136 | { |
137 | u32 status = 0; | 137 | int status = 0; |
138 | u8 *vfeequs_tbl_ptr = NULL; | 138 | u8 *vfeequs_tbl_ptr = NULL; |
139 | struct vbios_vfe_3x_header_struct vfeequs_tbl_header = { 0 }; | 139 | struct vbios_vfe_3x_header_struct vfeequs_tbl_header = { 0 }; |
140 | struct vbios_vfe_3x_equ_entry_struct equ = { 0 }; | 140 | struct vbios_vfe_3x_equ_entry_struct equ = { 0 }; |
@@ -329,7 +329,7 @@ done: | |||
329 | return status; | 329 | return status; |
330 | } | 330 | } |
331 | 331 | ||
332 | static u32 _vfe_equ_pmudatainit_super(struct gk20a *g, | 332 | static int _vfe_equ_pmudatainit_super(struct gk20a *g, |
333 | struct boardobj *board_obj_ptr, | 333 | struct boardobj *board_obj_ptr, |
334 | struct nv_pmu_boardobj *ppmudata) | 334 | struct nv_pmu_boardobj *ppmudata) |
335 | { | 335 | { |
@@ -357,13 +357,13 @@ static u32 _vfe_equ_pmudatainit_super(struct gk20a *g, | |||
357 | return status; | 357 | return status; |
358 | } | 358 | } |
359 | 359 | ||
360 | static u32 vfe_equ_construct_super(struct gk20a *g, | 360 | static int vfe_equ_construct_super(struct gk20a *g, |
361 | struct boardobj **ppboardobj, | 361 | struct boardobj **ppboardobj, |
362 | u16 size, void *pargs) | 362 | u16 size, void *pargs) |
363 | { | 363 | { |
364 | struct vfe_equ *pvfeequ; | 364 | struct vfe_equ *pvfeequ; |
365 | struct vfe_equ *ptmpequ = (struct vfe_equ *)pargs; | 365 | struct vfe_equ *ptmpequ = (struct vfe_equ *)pargs; |
366 | u32 status = 0; | 366 | int status = 0; |
367 | 367 | ||
368 | status = boardobj_construct_super(g, ppboardobj, | 368 | status = boardobj_construct_super(g, ppboardobj, |
369 | size, pargs); | 369 | size, pargs); |
@@ -384,11 +384,11 @@ static u32 vfe_equ_construct_super(struct gk20a *g, | |||
384 | return status; | 384 | return status; |
385 | } | 385 | } |
386 | 386 | ||
387 | static u32 _vfe_equ_pmudatainit_compare(struct gk20a *g, | 387 | static int _vfe_equ_pmudatainit_compare(struct gk20a *g, |
388 | struct boardobj *board_obj_ptr, | 388 | struct boardobj *board_obj_ptr, |
389 | struct nv_pmu_boardobj *ppmudata) | 389 | struct nv_pmu_boardobj *ppmudata) |
390 | { | 390 | { |
391 | u32 status = 0; | 391 | int status = 0; |
392 | struct vfe_equ_compare *pvfe_equ_compare; | 392 | struct vfe_equ_compare *pvfe_equ_compare; |
393 | struct nv_pmu_vfe_equ_compare *pset; | 393 | struct nv_pmu_vfe_equ_compare *pset; |
394 | 394 | ||
@@ -411,7 +411,7 @@ static u32 _vfe_equ_pmudatainit_compare(struct gk20a *g, | |||
411 | } | 411 | } |
412 | 412 | ||
413 | 413 | ||
414 | static u32 vfe_equ_construct_compare(struct gk20a *g, | 414 | static int vfe_equ_construct_compare(struct gk20a *g, |
415 | struct boardobj **ppboardobj, | 415 | struct boardobj **ppboardobj, |
416 | u16 size, void *pargs) | 416 | u16 size, void *pargs) |
417 | { | 417 | { |
@@ -419,7 +419,7 @@ static u32 vfe_equ_construct_compare(struct gk20a *g, | |||
419 | struct vfe_equ_compare *pvfeequ; | 419 | struct vfe_equ_compare *pvfeequ; |
420 | struct vfe_equ_compare *ptmpequ = | 420 | struct vfe_equ_compare *ptmpequ = |
421 | (struct vfe_equ_compare *)pargs; | 421 | (struct vfe_equ_compare *)pargs; |
422 | u32 status = 0; | 422 | int status = 0; |
423 | 423 | ||
424 | if (BOARDOBJ_GET_TYPE(pargs) != CTRL_PERF_VFE_EQU_TYPE_COMPARE) | 424 | if (BOARDOBJ_GET_TYPE(pargs) != CTRL_PERF_VFE_EQU_TYPE_COMPARE) |
425 | return -EINVAL; | 425 | return -EINVAL; |
@@ -443,11 +443,11 @@ static u32 vfe_equ_construct_compare(struct gk20a *g, | |||
443 | return status; | 443 | return status; |
444 | } | 444 | } |
445 | 445 | ||
446 | static u32 _vfe_equ_pmudatainit_minmax(struct gk20a *g, | 446 | static int _vfe_equ_pmudatainit_minmax(struct gk20a *g, |
447 | struct boardobj *board_obj_ptr, | 447 | struct boardobj *board_obj_ptr, |
448 | struct nv_pmu_boardobj *ppmudata) | 448 | struct nv_pmu_boardobj *ppmudata) |
449 | { | 449 | { |
450 | u32 status = 0; | 450 | int status = 0; |
451 | struct vfe_equ_minmax *pvfe_equ_minmax; | 451 | struct vfe_equ_minmax *pvfe_equ_minmax; |
452 | struct nv_pmu_vfe_equ_minmax *pset; | 452 | struct nv_pmu_vfe_equ_minmax *pset; |
453 | 453 | ||
@@ -469,7 +469,7 @@ static u32 _vfe_equ_pmudatainit_minmax(struct gk20a *g, | |||
469 | return status; | 469 | return status; |
470 | } | 470 | } |
471 | 471 | ||
472 | static u32 vfe_equ_construct_minmax(struct gk20a *g, | 472 | static int vfe_equ_construct_minmax(struct gk20a *g, |
473 | struct boardobj **ppboardobj, | 473 | struct boardobj **ppboardobj, |
474 | u16 size, void *pargs) | 474 | u16 size, void *pargs) |
475 | { | 475 | { |
@@ -477,7 +477,7 @@ static u32 vfe_equ_construct_minmax(struct gk20a *g, | |||
477 | struct vfe_equ_minmax *pvfeequ; | 477 | struct vfe_equ_minmax *pvfeequ; |
478 | struct vfe_equ_minmax *ptmpequ = | 478 | struct vfe_equ_minmax *ptmpequ = |
479 | (struct vfe_equ_minmax *)pargs; | 479 | (struct vfe_equ_minmax *)pargs; |
480 | u32 status = 0; | 480 | int status = 0; |
481 | 481 | ||
482 | if (BOARDOBJ_GET_TYPE(pargs) != CTRL_PERF_VFE_EQU_TYPE_MINMAX) | 482 | if (BOARDOBJ_GET_TYPE(pargs) != CTRL_PERF_VFE_EQU_TYPE_MINMAX) |
483 | return -EINVAL; | 483 | return -EINVAL; |
@@ -498,11 +498,11 @@ static u32 vfe_equ_construct_minmax(struct gk20a *g, | |||
498 | return status; | 498 | return status; |
499 | } | 499 | } |
500 | 500 | ||
501 | static u32 _vfe_equ_pmudatainit_quadratic(struct gk20a *g, | 501 | static int _vfe_equ_pmudatainit_quadratic(struct gk20a *g, |
502 | struct boardobj *board_obj_ptr, | 502 | struct boardobj *board_obj_ptr, |
503 | struct nv_pmu_boardobj *ppmudata) | 503 | struct nv_pmu_boardobj *ppmudata) |
504 | { | 504 | { |
505 | u32 status = 0; | 505 | int status = 0; |
506 | struct vfe_equ_quadratic *pvfe_equ_quadratic; | 506 | struct vfe_equ_quadratic *pvfe_equ_quadratic; |
507 | struct nv_pmu_vfe_equ_quadratic *pset; | 507 | struct nv_pmu_vfe_equ_quadratic *pset; |
508 | u32 i; | 508 | u32 i; |
@@ -524,7 +524,7 @@ static u32 _vfe_equ_pmudatainit_quadratic(struct gk20a *g, | |||
524 | return status; | 524 | return status; |
525 | } | 525 | } |
526 | 526 | ||
527 | static u32 vfe_equ_construct_quadratic(struct gk20a *g, | 527 | static int vfe_equ_construct_quadratic(struct gk20a *g, |
528 | struct boardobj **ppboardobj, | 528 | struct boardobj **ppboardobj, |
529 | u16 size, void *pargs) | 529 | u16 size, void *pargs) |
530 | { | 530 | { |
@@ -532,7 +532,7 @@ static u32 vfe_equ_construct_quadratic(struct gk20a *g, | |||
532 | struct vfe_equ_quadratic *pvfeequ; | 532 | struct vfe_equ_quadratic *pvfeequ; |
533 | struct vfe_equ_quadratic *ptmpequ = | 533 | struct vfe_equ_quadratic *ptmpequ = |
534 | (struct vfe_equ_quadratic *)pargs; | 534 | (struct vfe_equ_quadratic *)pargs; |
535 | u32 status = 0; | 535 | int status = 0; |
536 | u32 i; | 536 | u32 i; |
537 | 537 | ||
538 | if (BOARDOBJ_GET_TYPE(pargs) != CTRL_PERF_VFE_EQU_TYPE_QUADRATIC) | 538 | if (BOARDOBJ_GET_TYPE(pargs) != CTRL_PERF_VFE_EQU_TYPE_QUADRATIC) |
@@ -558,7 +558,7 @@ static u32 vfe_equ_construct_quadratic(struct gk20a *g, | |||
558 | static struct vfe_equ *construct_vfe_equ(struct gk20a *g, void *pargs) | 558 | static struct vfe_equ *construct_vfe_equ(struct gk20a *g, void *pargs) |
559 | { | 559 | { |
560 | struct boardobj *board_obj_ptr = NULL; | 560 | struct boardobj *board_obj_ptr = NULL; |
561 | u32 status; | 561 | int status; |
562 | 562 | ||
563 | nvgpu_log_info(g, " "); | 563 | nvgpu_log_info(g, " "); |
564 | 564 | ||
diff --git a/drivers/gpu/nvgpu/perf/vfe_equ.h b/drivers/gpu/nvgpu/perf/vfe_equ.h index 87888d82..486a48f8 100644 --- a/drivers/gpu/nvgpu/perf/vfe_equ.h +++ b/drivers/gpu/nvgpu/perf/vfe_equ.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * general perf structures & definitions | 2 | * general perf structures & definitions |
3 | * | 3 | * |
4 | * Copyright (c) 2016-2017, NVIDIA CORPORATION. All rights reserved. | 4 | * Copyright (c) 2016-2018, NVIDIA CORPORATION. All rights reserved. |
5 | * | 5 | * |
6 | * Permission is hereby granted, free of charge, to any person obtaining a | 6 | * Permission is hereby granted, free of charge, to any person obtaining a |
7 | * copy of this software and associated documentation files (the "Software"), | 7 | * copy of this software and associated documentation files (the "Software"), |
@@ -28,8 +28,8 @@ | |||
28 | #include "perf/vfe_var.h" | 28 | #include "perf/vfe_var.h" |
29 | #include <nvgpu/pmuif/nvgpu_gpmu_cmdif.h> | 29 | #include <nvgpu/pmuif/nvgpu_gpmu_cmdif.h> |
30 | 30 | ||
31 | u32 vfe_equ_sw_setup(struct gk20a *g); | 31 | int vfe_equ_sw_setup(struct gk20a *g); |
32 | u32 vfe_equ_pmu_setup(struct gk20a *g); | 32 | int vfe_equ_pmu_setup(struct gk20a *g); |
33 | 33 | ||
34 | #define VFE_EQU_GET(_pperf, _idx) \ | 34 | #define VFE_EQU_GET(_pperf, _idx) \ |
35 | ((struct vfe_equ *)BOARDOBJGRP_OBJ_GET_BY_IDX( \ | 35 | ((struct vfe_equ *)BOARDOBJGRP_OBJ_GET_BY_IDX( \ |
diff --git a/drivers/gpu/nvgpu/perf/vfe_var.c b/drivers/gpu/nvgpu/perf/vfe_var.c index 8b95230e..5f6e9de7 100644 --- a/drivers/gpu/nvgpu/perf/vfe_var.c +++ b/drivers/gpu/nvgpu/perf/vfe_var.c | |||
@@ -31,13 +31,13 @@ | |||
31 | #include "ctrl/ctrlvolt.h" | 31 | #include "ctrl/ctrlvolt.h" |
32 | #include "ctrl/ctrlperf.h" | 32 | #include "ctrl/ctrlperf.h" |
33 | 33 | ||
34 | static u32 devinit_get_vfe_var_table(struct gk20a *g, | 34 | static int devinit_get_vfe_var_table(struct gk20a *g, |
35 | struct vfe_vars *pvarobjs); | 35 | struct vfe_vars *pvarobjs); |
36 | static u32 vfe_var_construct_single(struct gk20a *g, | 36 | static int vfe_var_construct_single(struct gk20a *g, |
37 | struct boardobj **ppboardobj, | 37 | struct boardobj **ppboardobj, |
38 | u16 size, void *pargs); | 38 | u16 size, void *pargs); |
39 | 39 | ||
40 | static u32 _vfe_vars_pmudatainit(struct gk20a *g, | 40 | static int _vfe_vars_pmudatainit(struct gk20a *g, |
41 | struct boardobjgrp *pboardobjgrp, | 41 | struct boardobjgrp *pboardobjgrp, |
42 | struct nv_pmu_boardobjgrp_super *pboardobjgrppmu) | 42 | struct nv_pmu_boardobjgrp_super *pboardobjgrppmu) |
43 | { | 43 | { |
@@ -45,7 +45,7 @@ static u32 _vfe_vars_pmudatainit(struct gk20a *g, | |||
45 | (struct nv_pmu_perf_vfe_var_boardobjgrp_set_header *) | 45 | (struct nv_pmu_perf_vfe_var_boardobjgrp_set_header *) |
46 | pboardobjgrppmu; | 46 | pboardobjgrppmu; |
47 | struct vfe_vars *pvars = (struct vfe_vars *)pboardobjgrp; | 47 | struct vfe_vars *pvars = (struct vfe_vars *)pboardobjgrp; |
48 | u32 status = 0; | 48 | int status = 0; |
49 | 49 | ||
50 | status = boardobjgrp_pmudatainit_e32(g, pboardobjgrp, pboardobjgrppmu); | 50 | status = boardobjgrp_pmudatainit_e32(g, pboardobjgrp, pboardobjgrppmu); |
51 | if (status) { | 51 | if (status) { |
@@ -60,7 +60,7 @@ done: | |||
60 | return status; | 60 | return status; |
61 | } | 61 | } |
62 | 62 | ||
63 | static u32 _vfe_vars_pmudata_instget(struct gk20a *g, | 63 | static int _vfe_vars_pmudata_instget(struct gk20a *g, |
64 | struct nv_pmu_boardobjgrp *pmuboardobjgrp, | 64 | struct nv_pmu_boardobjgrp *pmuboardobjgrp, |
65 | struct nv_pmu_boardobj **ppboardobjpmudata, | 65 | struct nv_pmu_boardobj **ppboardobjpmudata, |
66 | u8 idx) | 66 | u8 idx) |
@@ -82,7 +82,7 @@ static u32 _vfe_vars_pmudata_instget(struct gk20a *g, | |||
82 | return 0; | 82 | return 0; |
83 | } | 83 | } |
84 | 84 | ||
85 | static u32 _vfe_vars_pmustatus_instget(struct gk20a *g, void *pboardobjgrppmu, | 85 | static int _vfe_vars_pmustatus_instget(struct gk20a *g, void *pboardobjgrppmu, |
86 | struct nv_pmu_boardobj_query **ppboardobjpmustatus, u8 idx) | 86 | struct nv_pmu_boardobj_query **ppboardobjpmustatus, u8 idx) |
87 | { | 87 | { |
88 | struct nv_pmu_perf_vfe_var_boardobj_grp_get_status *pgrp_get_status = | 88 | struct nv_pmu_perf_vfe_var_boardobj_grp_get_status *pgrp_get_status = |
@@ -99,7 +99,7 @@ static u32 _vfe_vars_pmustatus_instget(struct gk20a *g, void *pboardobjgrppmu, | |||
99 | } | 99 | } |
100 | 100 | ||
101 | 101 | ||
102 | u32 vfe_var_sw_setup(struct gk20a *g) | 102 | int vfe_var_sw_setup(struct gk20a *g) |
103 | { | 103 | { |
104 | u32 status; | 104 | u32 status; |
105 | struct boardobjgrp *pboardobjgrp = NULL; | 105 | struct boardobjgrp *pboardobjgrp = NULL; |
@@ -152,9 +152,9 @@ done: | |||
152 | return status; | 152 | return status; |
153 | } | 153 | } |
154 | 154 | ||
155 | u32 vfe_var_pmu_setup(struct gk20a *g) | 155 | int vfe_var_pmu_setup(struct gk20a *g) |
156 | { | 156 | { |
157 | u32 status; | 157 | int status; |
158 | struct boardobjgrp *pboardobjgrp = NULL; | 158 | struct boardobjgrp *pboardobjgrp = NULL; |
159 | 159 | ||
160 | nvgpu_log_info(g, " "); | 160 | nvgpu_log_info(g, " "); |
@@ -293,11 +293,11 @@ done: | |||
293 | return status; | 293 | return status; |
294 | } | 294 | } |
295 | 295 | ||
296 | static u32 _vfe_var_pmudatainit_super(struct gk20a *g, | 296 | static int _vfe_var_pmudatainit_super(struct gk20a *g, |
297 | struct boardobj *board_obj_ptr, | 297 | struct boardobj *board_obj_ptr, |
298 | struct nv_pmu_boardobj *ppmudata) | 298 | struct nv_pmu_boardobj *ppmudata) |
299 | { | 299 | { |
300 | u32 status = 0; | 300 | int status = 0; |
301 | struct vfe_var *pvfe_var; | 301 | struct vfe_var *pvfe_var; |
302 | struct nv_pmu_vfe_var *pset; | 302 | struct nv_pmu_vfe_var *pset; |
303 | 303 | ||
@@ -321,13 +321,13 @@ static u32 _vfe_var_pmudatainit_super(struct gk20a *g, | |||
321 | return status; | 321 | return status; |
322 | } | 322 | } |
323 | 323 | ||
324 | static u32 vfe_var_construct_super(struct gk20a *g, | 324 | static int vfe_var_construct_super(struct gk20a *g, |
325 | struct boardobj **ppboardobj, | 325 | struct boardobj **ppboardobj, |
326 | u16 size, void *pargs) | 326 | u16 size, void *pargs) |
327 | { | 327 | { |
328 | struct vfe_var *pvfevar; | 328 | struct vfe_var *pvfevar; |
329 | struct vfe_var *ptmpvar = (struct vfe_var *)pargs; | 329 | struct vfe_var *ptmpvar = (struct vfe_var *)pargs; |
330 | u32 status = 0; | 330 | int status = 0; |
331 | 331 | ||
332 | nvgpu_log_info(g, " "); | 332 | nvgpu_log_info(g, " "); |
333 | 333 | ||
@@ -350,11 +350,11 @@ static u32 vfe_var_construct_super(struct gk20a *g, | |||
350 | return status; | 350 | return status; |
351 | } | 351 | } |
352 | 352 | ||
353 | static u32 _vfe_var_pmudatainit_derived(struct gk20a *g, | 353 | static int _vfe_var_pmudatainit_derived(struct gk20a *g, |
354 | struct boardobj *board_obj_ptr, | 354 | struct boardobj *board_obj_ptr, |
355 | struct nv_pmu_boardobj *ppmudata) | 355 | struct nv_pmu_boardobj *ppmudata) |
356 | { | 356 | { |
357 | u32 status = 0; | 357 | int status = 0; |
358 | 358 | ||
359 | nvgpu_log_info(g, " "); | 359 | nvgpu_log_info(g, " "); |
360 | 360 | ||
@@ -363,12 +363,12 @@ static u32 _vfe_var_pmudatainit_derived(struct gk20a *g, | |||
363 | return status; | 363 | return status; |
364 | } | 364 | } |
365 | 365 | ||
366 | static u32 vfe_var_construct_derived(struct gk20a *g, | 366 | static int vfe_var_construct_derived(struct gk20a *g, |
367 | struct boardobj **ppboardobj, | 367 | struct boardobj **ppboardobj, |
368 | u16 size, void *pargs) | 368 | u16 size, void *pargs) |
369 | { | 369 | { |
370 | struct boardobj *ptmpobj = (struct boardobj *)pargs; | 370 | struct boardobj *ptmpobj = (struct boardobj *)pargs; |
371 | u32 status = 0; | 371 | int status = 0; |
372 | struct vfe_var_derived *pvfevar; | 372 | struct vfe_var_derived *pvfevar; |
373 | 373 | ||
374 | ptmpobj->type_mask |= BIT(CTRL_PERF_VFE_VAR_TYPE_DERIVED); | 374 | ptmpobj->type_mask |= BIT(CTRL_PERF_VFE_VAR_TYPE_DERIVED); |
@@ -384,11 +384,11 @@ static u32 vfe_var_construct_derived(struct gk20a *g, | |||
384 | return status; | 384 | return status; |
385 | } | 385 | } |
386 | 386 | ||
387 | static u32 _vfe_var_pmudatainit_derived_product(struct gk20a *g, | 387 | static int _vfe_var_pmudatainit_derived_product(struct gk20a *g, |
388 | struct boardobj *board_obj_ptr, | 388 | struct boardobj *board_obj_ptr, |
389 | struct nv_pmu_boardobj *ppmudata) | 389 | struct nv_pmu_boardobj *ppmudata) |
390 | { | 390 | { |
391 | u32 status = 0; | 391 | int status = 0; |
392 | struct vfe_var_derived_product *pvfe_var_derived_product; | 392 | struct vfe_var_derived_product *pvfe_var_derived_product; |
393 | struct nv_pmu_vfe_var_derived_product *pset; | 393 | struct nv_pmu_vfe_var_derived_product *pset; |
394 | 394 | ||
@@ -408,7 +408,7 @@ static u32 _vfe_var_pmudatainit_derived_product(struct gk20a *g, | |||
408 | return status; | 408 | return status; |
409 | } | 409 | } |
410 | 410 | ||
411 | static u32 vfe_var_construct_derived_product(struct gk20a *g, | 411 | static int vfe_var_construct_derived_product(struct gk20a *g, |
412 | struct boardobj **ppboardobj, | 412 | struct boardobj **ppboardobj, |
413 | u16 size, void *pargs) | 413 | u16 size, void *pargs) |
414 | { | 414 | { |
@@ -416,7 +416,7 @@ static u32 vfe_var_construct_derived_product(struct gk20a *g, | |||
416 | struct vfe_var_derived_product *pvfevar; | 416 | struct vfe_var_derived_product *pvfevar; |
417 | struct vfe_var_derived_product *ptmpvar = | 417 | struct vfe_var_derived_product *ptmpvar = |
418 | (struct vfe_var_derived_product *)pargs; | 418 | (struct vfe_var_derived_product *)pargs; |
419 | u32 status = 0; | 419 | int status = 0; |
420 | 420 | ||
421 | if (BOARDOBJ_GET_TYPE(pargs) != CTRL_PERF_VFE_VAR_TYPE_DERIVED_PRODUCT) | 421 | if (BOARDOBJ_GET_TYPE(pargs) != CTRL_PERF_VFE_VAR_TYPE_DERIVED_PRODUCT) |
422 | return -EINVAL; | 422 | return -EINVAL; |
@@ -438,11 +438,11 @@ static u32 vfe_var_construct_derived_product(struct gk20a *g, | |||
438 | return status; | 438 | return status; |
439 | } | 439 | } |
440 | 440 | ||
441 | static u32 _vfe_var_pmudatainit_derived_sum(struct gk20a *g, | 441 | static int _vfe_var_pmudatainit_derived_sum(struct gk20a *g, |
442 | struct boardobj *board_obj_ptr, | 442 | struct boardobj *board_obj_ptr, |
443 | struct nv_pmu_boardobj *ppmudata) | 443 | struct nv_pmu_boardobj *ppmudata) |
444 | { | 444 | { |
445 | u32 status = 0; | 445 | int status = 0; |
446 | struct vfe_var_derived_sum *pvfe_var_derived_sum; | 446 | struct vfe_var_derived_sum *pvfe_var_derived_sum; |
447 | struct nv_pmu_vfe_var_derived_sum *pset; | 447 | struct nv_pmu_vfe_var_derived_sum *pset; |
448 | 448 | ||
@@ -461,7 +461,7 @@ static u32 _vfe_var_pmudatainit_derived_sum(struct gk20a *g, | |||
461 | return status; | 461 | return status; |
462 | } | 462 | } |
463 | 463 | ||
464 | static u32 vfe_var_construct_derived_sum(struct gk20a *g, | 464 | static int vfe_var_construct_derived_sum(struct gk20a *g, |
465 | struct boardobj **ppboardobj, | 465 | struct boardobj **ppboardobj, |
466 | u16 size, void *pargs) | 466 | u16 size, void *pargs) |
467 | { | 467 | { |
@@ -469,7 +469,7 @@ static u32 vfe_var_construct_derived_sum(struct gk20a *g, | |||
469 | struct vfe_var_derived_sum *pvfevar; | 469 | struct vfe_var_derived_sum *pvfevar; |
470 | struct vfe_var_derived_sum *ptmpvar = | 470 | struct vfe_var_derived_sum *ptmpvar = |
471 | (struct vfe_var_derived_sum *)pargs; | 471 | (struct vfe_var_derived_sum *)pargs; |
472 | u32 status = 0; | 472 | int status = 0; |
473 | 473 | ||
474 | if (BOARDOBJ_GET_TYPE(pargs) != CTRL_PERF_VFE_VAR_TYPE_DERIVED_SUM) | 474 | if (BOARDOBJ_GET_TYPE(pargs) != CTRL_PERF_VFE_VAR_TYPE_DERIVED_SUM) |
475 | return -EINVAL; | 475 | return -EINVAL; |
@@ -490,11 +490,11 @@ static u32 vfe_var_construct_derived_sum(struct gk20a *g, | |||
490 | return status; | 490 | return status; |
491 | } | 491 | } |
492 | 492 | ||
493 | static u32 _vfe_var_pmudatainit_single(struct gk20a *g, | 493 | static int _vfe_var_pmudatainit_single(struct gk20a *g, |
494 | struct boardobj *board_obj_ptr, | 494 | struct boardobj *board_obj_ptr, |
495 | struct nv_pmu_boardobj *ppmudata) | 495 | struct nv_pmu_boardobj *ppmudata) |
496 | { | 496 | { |
497 | u32 status = 0; | 497 | int status = 0; |
498 | struct vfe_var_single *pvfe_var_single; | 498 | struct vfe_var_single *pvfe_var_single; |
499 | struct nv_pmu_vfe_var_single *pset; | 499 | struct nv_pmu_vfe_var_single *pset; |
500 | 500 | ||
@@ -514,11 +514,11 @@ static u32 _vfe_var_pmudatainit_single(struct gk20a *g, | |||
514 | return status; | 514 | return status; |
515 | } | 515 | } |
516 | 516 | ||
517 | static u32 _vfe_var_pmudatainit_single_frequency(struct gk20a *g, | 517 | static int _vfe_var_pmudatainit_single_frequency(struct gk20a *g, |
518 | struct boardobj *board_obj_ptr, | 518 | struct boardobj *board_obj_ptr, |
519 | struct nv_pmu_boardobj *ppmudata) | 519 | struct nv_pmu_boardobj *ppmudata) |
520 | { | 520 | { |
521 | u32 status = 0; | 521 | int status = 0; |
522 | 522 | ||
523 | nvgpu_log_info(g, " "); | 523 | nvgpu_log_info(g, " "); |
524 | 524 | ||
@@ -557,11 +557,11 @@ static u32 vfe_var_construct_single_frequency(struct gk20a *g, | |||
557 | return status; | 557 | return status; |
558 | } | 558 | } |
559 | 559 | ||
560 | static u32 _vfe_var_pmudatainit_single_sensed(struct gk20a *g, | 560 | static int _vfe_var_pmudatainit_single_sensed(struct gk20a *g, |
561 | struct boardobj *board_obj_ptr, | 561 | struct boardobj *board_obj_ptr, |
562 | struct nv_pmu_boardobj *ppmudata) | 562 | struct nv_pmu_boardobj *ppmudata) |
563 | { | 563 | { |
564 | u32 status = 0; | 564 | int status = 0; |
565 | 565 | ||
566 | nvgpu_log_info(g, " "); | 566 | nvgpu_log_info(g, " "); |
567 | 567 | ||
@@ -570,11 +570,11 @@ static u32 _vfe_var_pmudatainit_single_sensed(struct gk20a *g, | |||
570 | return status; | 570 | return status; |
571 | } | 571 | } |
572 | 572 | ||
573 | static u32 _vfe_var_pmudatainit_single_sensed_fuse(struct gk20a *g, | 573 | static int _vfe_var_pmudatainit_single_sensed_fuse(struct gk20a *g, |
574 | struct boardobj *board_obj_ptr, | 574 | struct boardobj *board_obj_ptr, |
575 | struct nv_pmu_boardobj *ppmudata) | 575 | struct nv_pmu_boardobj *ppmudata) |
576 | { | 576 | { |
577 | u32 status = 0; | 577 | int status = 0; |
578 | struct vfe_var_single_sensed_fuse *pvfe_var_single_sensed_fuse; | 578 | struct vfe_var_single_sensed_fuse *pvfe_var_single_sensed_fuse; |
579 | struct nv_pmu_vfe_var_single_sensed_fuse *pset; | 579 | struct nv_pmu_vfe_var_single_sensed_fuse *pset; |
580 | 580 | ||
@@ -696,11 +696,11 @@ exit: | |||
696 | return status; | 696 | return status; |
697 | } | 697 | } |
698 | 698 | ||
699 | static u32 _vfe_var_pmudatainit_single_sensed_temp(struct gk20a *g, | 699 | static int _vfe_var_pmudatainit_single_sensed_temp(struct gk20a *g, |
700 | struct boardobj *board_obj_ptr, | 700 | struct boardobj *board_obj_ptr, |
701 | struct nv_pmu_boardobj *ppmudata) | 701 | struct nv_pmu_boardobj *ppmudata) |
702 | { | 702 | { |
703 | u32 status = 0; | 703 | int status = 0; |
704 | struct vfe_var_single_sensed_temp *pvfe_var_single_sensed_temp; | 704 | struct vfe_var_single_sensed_temp *pvfe_var_single_sensed_temp; |
705 | struct nv_pmu_vfe_var_single_sensed_temp *pset; | 705 | struct nv_pmu_vfe_var_single_sensed_temp *pset; |
706 | 706 | ||
@@ -763,11 +763,11 @@ static u32 vfe_var_construct_single_sensed_temp(struct gk20a *g, | |||
763 | return status; | 763 | return status; |
764 | } | 764 | } |
765 | 765 | ||
766 | static u32 _vfe_var_pmudatainit_single_voltage(struct gk20a *g, | 766 | static int _vfe_var_pmudatainit_single_voltage(struct gk20a *g, |
767 | struct boardobj *board_obj_ptr, | 767 | struct boardobj *board_obj_ptr, |
768 | struct nv_pmu_boardobj *ppmudata) | 768 | struct nv_pmu_boardobj *ppmudata) |
769 | { | 769 | { |
770 | u32 status = 0; | 770 | int status = 0; |
771 | 771 | ||
772 | nvgpu_log_info(g, " "); | 772 | nvgpu_log_info(g, " "); |
773 | 773 | ||
@@ -776,13 +776,13 @@ static u32 _vfe_var_pmudatainit_single_voltage(struct gk20a *g, | |||
776 | return status; | 776 | return status; |
777 | } | 777 | } |
778 | 778 | ||
779 | static u32 vfe_var_construct_single_voltage(struct gk20a *g, | 779 | static int vfe_var_construct_single_voltage(struct gk20a *g, |
780 | struct boardobj **ppboardobj, | 780 | struct boardobj **ppboardobj, |
781 | u16 size, void *pargs) | 781 | u16 size, void *pargs) |
782 | { | 782 | { |
783 | struct boardobj *ptmpobj = (struct boardobj *)pargs; | 783 | struct boardobj *ptmpobj = (struct boardobj *)pargs; |
784 | struct vfe_var_single_voltage *pvfevar; | 784 | struct vfe_var_single_voltage *pvfevar; |
785 | u32 status = 0; | 785 | int status = 0; |
786 | 786 | ||
787 | if (BOARDOBJ_GET_TYPE(pargs) != CTRL_PERF_VFE_VAR_TYPE_SINGLE_VOLTAGE) | 787 | if (BOARDOBJ_GET_TYPE(pargs) != CTRL_PERF_VFE_VAR_TYPE_SINGLE_VOLTAGE) |
788 | return -EINVAL; | 788 | return -EINVAL; |
@@ -806,7 +806,7 @@ static u32 vfe_var_construct_single_voltage(struct gk20a *g, | |||
806 | static struct vfe_var *construct_vfe_var(struct gk20a *g, void *pargs) | 806 | static struct vfe_var *construct_vfe_var(struct gk20a *g, void *pargs) |
807 | { | 807 | { |
808 | struct boardobj *board_obj_ptr = NULL; | 808 | struct boardobj *board_obj_ptr = NULL; |
809 | u32 status; | 809 | int status; |
810 | 810 | ||
811 | nvgpu_log_info(g, " "); | 811 | nvgpu_log_info(g, " "); |
812 | switch (BOARDOBJ_GET_TYPE(pargs)) { | 812 | switch (BOARDOBJ_GET_TYPE(pargs)) { |
@@ -855,10 +855,10 @@ static struct vfe_var *construct_vfe_var(struct gk20a *g, void *pargs) | |||
855 | return (struct vfe_var *)board_obj_ptr; | 855 | return (struct vfe_var *)board_obj_ptr; |
856 | } | 856 | } |
857 | 857 | ||
858 | static u32 devinit_get_vfe_var_table(struct gk20a *g, | 858 | static int devinit_get_vfe_var_table(struct gk20a *g, |
859 | struct vfe_vars *pvfevarobjs) | 859 | struct vfe_vars *pvfevarobjs) |
860 | { | 860 | { |
861 | u32 status = 0; | 861 | int status = 0; |
862 | u8 *vfevars_tbl_ptr = NULL; | 862 | u8 *vfevars_tbl_ptr = NULL; |
863 | struct vbios_vfe_3x_header_struct vfevars_tbl_header = { 0 }; | 863 | struct vbios_vfe_3x_header_struct vfevars_tbl_header = { 0 }; |
864 | struct vbios_vfe_3x_var_entry_struct var = { 0 }; | 864 | struct vbios_vfe_3x_var_entry_struct var = { 0 }; |
@@ -1035,13 +1035,13 @@ done: | |||
1035 | return status; | 1035 | return status; |
1036 | } | 1036 | } |
1037 | 1037 | ||
1038 | static u32 vfe_var_construct_single(struct gk20a *g, | 1038 | static int vfe_var_construct_single(struct gk20a *g, |
1039 | struct boardobj **ppboardobj, | 1039 | struct boardobj **ppboardobj, |
1040 | u16 size, void *pargs) | 1040 | u16 size, void *pargs) |
1041 | { | 1041 | { |
1042 | struct boardobj *ptmpobj = (struct boardobj *)pargs; | 1042 | struct boardobj *ptmpobj = (struct boardobj *)pargs; |
1043 | struct vfe_var_single *pvfevar; | 1043 | struct vfe_var_single *pvfevar; |
1044 | u32 status = 0; | 1044 | int status = 0; |
1045 | 1045 | ||
1046 | nvgpu_log_info(g, " "); | 1046 | nvgpu_log_info(g, " "); |
1047 | 1047 | ||
diff --git a/drivers/gpu/nvgpu/perf/vfe_var.h b/drivers/gpu/nvgpu/perf/vfe_var.h index 3364f994..535600a7 100644 --- a/drivers/gpu/nvgpu/perf/vfe_var.h +++ b/drivers/gpu/nvgpu/perf/vfe_var.h | |||
@@ -26,8 +26,8 @@ | |||
26 | #include "boardobj/boardobjgrp.h" | 26 | #include "boardobj/boardobjgrp.h" |
27 | #include <nvgpu/pmuif/nvgpu_gpmu_cmdif.h> | 27 | #include <nvgpu/pmuif/nvgpu_gpmu_cmdif.h> |
28 | 28 | ||
29 | u32 vfe_var_sw_setup(struct gk20a *g); | 29 | int vfe_var_sw_setup(struct gk20a *g); |
30 | u32 vfe_var_pmu_setup(struct gk20a *g); | 30 | int vfe_var_pmu_setup(struct gk20a *g); |
31 | 31 | ||
32 | #define VFE_VAR_GET(_pperf, _idx) \ | 32 | #define VFE_VAR_GET(_pperf, _idx) \ |
33 | ((struct vfe_var)BOARDOBJGRP_OBJ_GET_BY_IDX( \ | 33 | ((struct vfe_var)BOARDOBJGRP_OBJ_GET_BY_IDX( \ |