summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/clk/clk_vin.c
diff options
context:
space:
mode:
authorPhilip Elcan <pelcan@nvidia.com>2018-08-29 15:46:12 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2018-09-07 00:33:50 -0400
commit7f8226887c28267d3c2351692d4429ead1e17695 (patch)
treeaa09c45e496b058044c9d9a94c94d9922c572285 /drivers/gpu/nvgpu/clk/clk_vin.c
parent0e58ebaae13dd59b6aba5297f898e7c89fcd2742 (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/clk/clk_vin.c')
-rw-r--r--drivers/gpu/nvgpu/clk/clk_vin.c60
1 files changed, 30 insertions, 30 deletions
diff --git a/drivers/gpu/nvgpu/clk/clk_vin.c b/drivers/gpu/nvgpu/clk/clk_vin.c
index 1c18b662..9a163594 100644
--- a/drivers/gpu/nvgpu/clk/clk_vin.c
+++ b/drivers/gpu/nvgpu/clk/clk_vin.c
@@ -36,27 +36,27 @@
36#include "clk.h" 36#include "clk.h"
37#include "clk_vin.h" 37#include "clk_vin.h"
38 38
39static u32 devinit_get_vin_device_table(struct gk20a *g, 39static int devinit_get_vin_device_table(struct gk20a *g,
40 struct avfsvinobjs *pvinobjs); 40 struct avfsvinobjs *pvinobjs);
41 41
42static u32 vin_device_construct_v10(struct gk20a *g, 42static int vin_device_construct_v10(struct gk20a *g,
43 struct boardobj **ppboardobj, 43 struct boardobj **ppboardobj,
44 u16 size, void *pargs); 44 u16 size, void *pargs);
45static u32 vin_device_construct_v20(struct gk20a *g, 45static int vin_device_construct_v20(struct gk20a *g,
46 struct boardobj **ppboardobj, 46 struct boardobj **ppboardobj,
47 u16 size, void *pargs); 47 u16 size, void *pargs);
48static u32 vin_device_construct_super(struct gk20a *g, 48static int vin_device_construct_super(struct gk20a *g,
49 struct boardobj **ppboardobj, 49 struct boardobj **ppboardobj,
50 u16 size, void *pargs); 50 u16 size, void *pargs);
51static struct vin_device *construct_vin_device(struct gk20a *g, void *pargs); 51static struct vin_device *construct_vin_device(struct gk20a *g, void *pargs);
52 52
53static u32 vin_device_init_pmudata_v10(struct gk20a *g, 53static int vin_device_init_pmudata_v10(struct gk20a *g,
54 struct boardobj *board_obj_ptr, 54 struct boardobj *board_obj_ptr,
55 struct nv_pmu_boardobj *ppmudata); 55 struct nv_pmu_boardobj *ppmudata);
56static u32 vin_device_init_pmudata_v20(struct gk20a *g, 56static int vin_device_init_pmudata_v20(struct gk20a *g,
57 struct boardobj *board_obj_ptr, 57 struct boardobj *board_obj_ptr,
58 struct nv_pmu_boardobj *ppmudata); 58 struct nv_pmu_boardobj *ppmudata);
59static u32 vin_device_init_pmudata_super(struct gk20a *g, 59static int vin_device_init_pmudata_super(struct gk20a *g,
60 struct boardobj *board_obj_ptr, 60 struct boardobj *board_obj_ptr,
61 struct nv_pmu_boardobj *ppmudata); 61 struct nv_pmu_boardobj *ppmudata);
62 62
@@ -122,7 +122,7 @@ u32 clk_avfs_get_vin_cal_fuse_v20(struct gk20a *g,
122 122
123} 123}
124 124
125static u32 _clk_vin_devgrp_pmudatainit_super(struct gk20a *g, 125static int _clk_vin_devgrp_pmudatainit_super(struct gk20a *g,
126 struct boardobjgrp *pboardobjgrp, 126 struct boardobjgrp *pboardobjgrp,
127 struct nv_pmu_boardobjgrp_super *pboardobjgrppmu) 127 struct nv_pmu_boardobjgrp_super *pboardobjgrppmu)
128{ 128{
@@ -130,7 +130,7 @@ static u32 _clk_vin_devgrp_pmudatainit_super(struct gk20a *g,
130 (struct nv_pmu_clk_clk_vin_device_boardobjgrp_set_header *) 130 (struct nv_pmu_clk_clk_vin_device_boardobjgrp_set_header *)
131 pboardobjgrppmu; 131 pboardobjgrppmu;
132 struct avfsvinobjs *pvin_obbj = (struct avfsvinobjs *)pboardobjgrp; 132 struct avfsvinobjs *pvin_obbj = (struct avfsvinobjs *)pboardobjgrp;
133 u32 status = 0; 133 int status = 0;
134 134
135 nvgpu_log_info(g, " "); 135 nvgpu_log_info(g, " ");
136 136
@@ -142,7 +142,7 @@ static u32 _clk_vin_devgrp_pmudatainit_super(struct gk20a *g,
142 return status; 142 return status;
143} 143}
144 144
145static u32 _clk_vin_devgrp_pmudata_instget(struct gk20a *g, 145static int _clk_vin_devgrp_pmudata_instget(struct gk20a *g,
146 struct nv_pmu_boardobjgrp *pmuboardobjgrp, 146 struct nv_pmu_boardobjgrp *pmuboardobjgrp,
147 struct nv_pmu_boardobj **ppboardobjpmudata, 147 struct nv_pmu_boardobj **ppboardobjpmudata,
148 u8 idx) 148 u8 idx)
@@ -165,7 +165,7 @@ static u32 _clk_vin_devgrp_pmudata_instget(struct gk20a *g,
165 return 0; 165 return 0;
166} 166}
167 167
168static u32 _clk_vin_devgrp_pmustatus_instget(struct gk20a *g, 168static int _clk_vin_devgrp_pmustatus_instget(struct gk20a *g,
169 void *pboardobjgrppmu, 169 void *pboardobjgrppmu,
170 struct nv_pmu_boardobj_query **ppboardobjpmustatus, 170 struct nv_pmu_boardobj_query **ppboardobjpmustatus,
171 u8 idx) 171 u8 idx)
@@ -185,9 +185,9 @@ static u32 _clk_vin_devgrp_pmustatus_instget(struct gk20a *g,
185 return 0; 185 return 0;
186} 186}
187 187
188u32 clk_vin_sw_setup(struct gk20a *g) 188int clk_vin_sw_setup(struct gk20a *g)
189{ 189{
190 u32 status; 190 int status;
191 struct boardobjgrp *pboardobjgrp = NULL; 191 struct boardobjgrp *pboardobjgrp = NULL;
192 struct vin_device_v20 *pvindev = NULL; 192 struct vin_device_v20 *pvindev = NULL;
193 struct avfsvinobjs *pvinobjs; 193 struct avfsvinobjs *pvinobjs;
@@ -243,9 +243,9 @@ done:
243 return status; 243 return status;
244} 244}
245 245
246u32 clk_vin_pmu_setup(struct gk20a *g) 246int clk_vin_pmu_setup(struct gk20a *g)
247{ 247{
248 u32 status; 248 int status;
249 struct boardobjgrp *pboardobjgrp = NULL; 249 struct boardobjgrp *pboardobjgrp = NULL;
250 250
251 nvgpu_log_info(g, " "); 251 nvgpu_log_info(g, " ");
@@ -262,10 +262,10 @@ u32 clk_vin_pmu_setup(struct gk20a *g)
262 return status; 262 return status;
263} 263}
264 264
265static u32 devinit_get_vin_device_table(struct gk20a *g, 265static int devinit_get_vin_device_table(struct gk20a *g,
266 struct avfsvinobjs *pvinobjs) 266 struct avfsvinobjs *pvinobjs)
267{ 267{
268 u32 status = 0; 268 int status = 0;
269 u8 *vin_table_ptr = NULL; 269 u8 *vin_table_ptr = NULL;
270 struct vin_descriptor_header_10 vin_desc_table_header = { 0 }; 270 struct vin_descriptor_header_10 vin_desc_table_header = { 0 };
271 struct vin_descriptor_entry_10 vin_desc_table_entry = { 0 }; 271 struct vin_descriptor_entry_10 vin_desc_table_entry = { 0 };
@@ -376,14 +376,14 @@ done:
376 return status; 376 return status;
377} 377}
378 378
379static u32 vin_device_construct_v10(struct gk20a *g, 379static int vin_device_construct_v10(struct gk20a *g,
380 struct boardobj **ppboardobj, 380 struct boardobj **ppboardobj,
381 u16 size, void *pargs) 381 u16 size, void *pargs)
382{ 382{
383 struct boardobj *ptmpobj = (struct boardobj *)pargs; 383 struct boardobj *ptmpobj = (struct boardobj *)pargs;
384 struct vin_device_v10 *pvin_device_v10; 384 struct vin_device_v10 *pvin_device_v10;
385 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;
386 u32 status = 0; 386 int status = 0;
387 387
388 if (BOARDOBJ_GET_TYPE(pargs) != CTRL_CLK_VIN_TYPE_V10) { 388 if (BOARDOBJ_GET_TYPE(pargs) != CTRL_CLK_VIN_TYPE_V10) {
389 return -EINVAL; 389 return -EINVAL;
@@ -406,14 +406,14 @@ static u32 vin_device_construct_v10(struct gk20a *g,
406 return status; 406 return status;
407} 407}
408 408
409static u32 vin_device_construct_v20(struct gk20a *g, 409static int vin_device_construct_v20(struct gk20a *g,
410 struct boardobj **ppboardobj, 410 struct boardobj **ppboardobj,
411 u16 size, void *pargs) 411 u16 size, void *pargs)
412{ 412{
413 struct boardobj *ptmpobj = (struct boardobj *)pargs; 413 struct boardobj *ptmpobj = (struct boardobj *)pargs;
414 struct vin_device_v20 *pvin_device_v20; 414 struct vin_device_v20 *pvin_device_v20;
415 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;
416 u32 status = 0; 416 int status = 0;
417 417
418 if (BOARDOBJ_GET_TYPE(pargs) != CTRL_CLK_VIN_TYPE_V20) { 418 if (BOARDOBJ_GET_TYPE(pargs) != CTRL_CLK_VIN_TYPE_V20) {
419 return -EINVAL; 419 return -EINVAL;
@@ -435,13 +435,13 @@ static u32 vin_device_construct_v20(struct gk20a *g,
435 435
436 return status; 436 return status;
437} 437}
438static u32 vin_device_construct_super(struct gk20a *g, 438static int vin_device_construct_super(struct gk20a *g,
439 struct boardobj **ppboardobj, 439 struct boardobj **ppboardobj,
440 u16 size, void *pargs) 440 u16 size, void *pargs)
441{ 441{
442 struct vin_device *pvin_device; 442 struct vin_device *pvin_device;
443 struct vin_device *ptmpvin_device = (struct vin_device *)pargs; 443 struct vin_device *ptmpvin_device = (struct vin_device *)pargs;
444 u32 status = 0; 444 int status = 0;
445 status = boardobj_construct_super(g, ppboardobj, size, pargs); 445 status = boardobj_construct_super(g, ppboardobj, size, pargs);
446 446
447 if (status) { 447 if (status) {
@@ -463,7 +463,7 @@ static u32 vin_device_construct_super(struct gk20a *g,
463static struct vin_device *construct_vin_device(struct gk20a *g, void *pargs) 463static struct vin_device *construct_vin_device(struct gk20a *g, void *pargs)
464{ 464{
465 struct boardobj *board_obj_ptr = NULL; 465 struct boardobj *board_obj_ptr = NULL;
466 u32 status; 466 int status;
467 467
468 nvgpu_log_info(g, " %d", BOARDOBJ_GET_TYPE(pargs)); 468 nvgpu_log_info(g, " %d", BOARDOBJ_GET_TYPE(pargs));
469 switch (BOARDOBJ_GET_TYPE(pargs)) { 469 switch (BOARDOBJ_GET_TYPE(pargs)) {
@@ -492,11 +492,11 @@ static struct vin_device *construct_vin_device(struct gk20a *g, void *pargs)
492 492
493 493
494 494
495static u32 vin_device_init_pmudata_v10(struct gk20a *g, 495static int vin_device_init_pmudata_v10(struct gk20a *g,
496 struct boardobj *board_obj_ptr, 496 struct boardobj *board_obj_ptr,
497 struct nv_pmu_boardobj *ppmudata) 497 struct nv_pmu_boardobj *ppmudata)
498{ 498{
499 u32 status = 0; 499 int status = 0;
500 struct vin_device_v20 *pvin_dev_v20; 500 struct vin_device_v20 *pvin_dev_v20;
501 struct nv_pmu_clk_clk_vin_device_v10_boardobj_set *perf_pmu_data; 501 struct nv_pmu_clk_clk_vin_device_v10_boardobj_set *perf_pmu_data;
502 502
@@ -519,11 +519,11 @@ static u32 vin_device_init_pmudata_v10(struct gk20a *g,
519 return status; 519 return status;
520} 520}
521 521
522static u32 vin_device_init_pmudata_v20(struct gk20a *g, 522static int vin_device_init_pmudata_v20(struct gk20a *g,
523 struct boardobj *board_obj_ptr, 523 struct boardobj *board_obj_ptr,
524 struct nv_pmu_boardobj *ppmudata) 524 struct nv_pmu_boardobj *ppmudata)
525{ 525{
526 u32 status = 0; 526 int status = 0;
527 struct vin_device_v20 *pvin_dev_v20; 527 struct vin_device_v20 *pvin_dev_v20;
528 struct nv_pmu_clk_clk_vin_device_v20_boardobj_set *perf_pmu_data; 528 struct nv_pmu_clk_clk_vin_device_v20_boardobj_set *perf_pmu_data;
529 529
@@ -546,11 +546,11 @@ static u32 vin_device_init_pmudata_v20(struct gk20a *g,
546 return status; 546 return status;
547} 547}
548 548
549static u32 vin_device_init_pmudata_super(struct gk20a *g, 549static int vin_device_init_pmudata_super(struct gk20a *g,
550 struct boardobj *board_obj_ptr, 550 struct boardobj *board_obj_ptr,
551 struct nv_pmu_boardobj *ppmudata) 551 struct nv_pmu_boardobj *ppmudata)
552{ 552{
553 u32 status = 0; 553 int status = 0;
554 struct vin_device *pvin_dev; 554 struct vin_device *pvin_dev;
555 struct nv_pmu_clk_clk_vin_device_boardobj_set *perf_pmu_data; 555 struct nv_pmu_clk_clk_vin_device_boardobj_set *perf_pmu_data;
556 556