summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/therm
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/therm
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/therm')
-rw-r--r--drivers/gpu/nvgpu/therm/thrmchannel.c16
-rw-r--r--drivers/gpu/nvgpu/therm/thrmchannel.h4
-rw-r--r--drivers/gpu/nvgpu/therm/thrmdev.c36
-rw-r--r--drivers/gpu/nvgpu/therm/thrmdev.h4
-rw-r--r--drivers/gpu/nvgpu/therm/thrmpmu.c6
-rw-r--r--drivers/gpu/nvgpu/therm/thrmpmu.h4
6 files changed, 35 insertions, 35 deletions
diff --git a/drivers/gpu/nvgpu/therm/thrmchannel.c b/drivers/gpu/nvgpu/therm/thrmchannel.c
index de3de62a..7d196422 100644
--- a/drivers/gpu/nvgpu/therm/thrmchannel.c
+++ b/drivers/gpu/nvgpu/therm/thrmchannel.c
@@ -29,11 +29,11 @@
29#include "boardobj/boardobjgrp_e32.h" 29#include "boardobj/boardobjgrp_e32.h"
30#include "gp106/bios_gp106.h" 30#include "gp106/bios_gp106.h"
31 31
32static u32 _therm_channel_pmudatainit_device(struct gk20a *g, 32static int _therm_channel_pmudatainit_device(struct gk20a *g,
33 struct boardobj *board_obj_ptr, 33 struct boardobj *board_obj_ptr,
34 struct nv_pmu_boardobj *ppmudata) 34 struct nv_pmu_boardobj *ppmudata)
35{ 35{
36 u32 status = 0; 36 int status = 0;
37 struct therm_channel *pchannel; 37 struct therm_channel *pchannel;
38 struct therm_channel_device *ptherm_channel; 38 struct therm_channel_device *ptherm_channel;
39 struct nv_pmu_therm_therm_channel_device_boardobj_set *pset; 39 struct nv_pmu_therm_therm_channel_device_boardobj_set *pset;
@@ -68,7 +68,7 @@ static struct boardobj *construct_channel_device(struct gk20a *g,
68 struct boardobj *board_obj_ptr = NULL; 68 struct boardobj *board_obj_ptr = NULL;
69 struct therm_channel *pchannel; 69 struct therm_channel *pchannel;
70 struct therm_channel_device *pchannel_device; 70 struct therm_channel_device *pchannel_device;
71 u32 status; 71 int status;
72 struct therm_channel_device *therm_device = (struct therm_channel_device*)pargs; 72 struct therm_channel_device *therm_device = (struct therm_channel_device*)pargs;
73 73
74 status = boardobj_construct_super(g, &board_obj_ptr, 74 status = boardobj_construct_super(g, &board_obj_ptr,
@@ -95,7 +95,7 @@ static struct boardobj *construct_channel_device(struct gk20a *g,
95 return board_obj_ptr; 95 return board_obj_ptr;
96} 96}
97 97
98static u32 _therm_channel_pmudata_instget(struct gk20a *g, 98static int _therm_channel_pmudata_instget(struct gk20a *g,
99 struct nv_pmu_boardobjgrp *pmuboardobjgrp, 99 struct nv_pmu_boardobjgrp *pmuboardobjgrp,
100 struct nv_pmu_boardobj **ppboardobjpmudata, 100 struct nv_pmu_boardobj **ppboardobjpmudata,
101 u8 idx) 101 u8 idx)
@@ -119,10 +119,10 @@ static u32 _therm_channel_pmudata_instget(struct gk20a *g,
119 return 0; 119 return 0;
120} 120}
121 121
122static u32 devinit_get_therm_channel_table(struct gk20a *g, 122static int devinit_get_therm_channel_table(struct gk20a *g,
123 struct therm_channels *pthermchannelobjs) 123 struct therm_channels *pthermchannelobjs)
124{ 124{
125 u32 status = 0; 125 int status = 0;
126 u8 *therm_channel_table_ptr = NULL; 126 u8 *therm_channel_table_ptr = NULL;
127 u8 *curr_therm_channel_table_ptr = NULL; 127 u8 *curr_therm_channel_table_ptr = NULL;
128 struct boardobj *boardobj; 128 struct boardobj *boardobj;
@@ -210,9 +210,9 @@ done:
210 return status; 210 return status;
211} 211}
212 212
213u32 therm_channel_sw_setup(struct gk20a *g) 213int therm_channel_sw_setup(struct gk20a *g)
214{ 214{
215 u32 status; 215 int status;
216 struct boardobjgrp *pboardobjgrp = NULL; 216 struct boardobjgrp *pboardobjgrp = NULL;
217 struct therm_channels *pthermchannelobjs; 217 struct therm_channels *pthermchannelobjs;
218 218
diff --git a/drivers/gpu/nvgpu/therm/thrmchannel.h b/drivers/gpu/nvgpu/therm/thrmchannel.h
index 4e0dd2e4..a2045c26 100644
--- a/drivers/gpu/nvgpu/therm/thrmchannel.h
+++ b/drivers/gpu/nvgpu/therm/thrmchannel.h
@@ -1,7 +1,7 @@
1/* 1/*
2 * general thermal device structures & definitions 2 * general thermal device structures & definitions
3 * 3 *
4 * Copyright (c) 2016, 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"),
@@ -46,6 +46,6 @@ struct therm_channel_device {
46 u8 therm_dev_prov_idx; 46 u8 therm_dev_prov_idx;
47}; 47};
48 48
49u32 therm_channel_sw_setup(struct gk20a *g); 49int therm_channel_sw_setup(struct gk20a *g);
50 50
51#endif 51#endif
diff --git a/drivers/gpu/nvgpu/therm/thrmdev.c b/drivers/gpu/nvgpu/therm/thrmdev.c
index aaf0a461..ddd1f280 100644
--- a/drivers/gpu/nvgpu/therm/thrmdev.c
+++ b/drivers/gpu/nvgpu/therm/thrmdev.c
@@ -30,7 +30,7 @@
30#include "gp106/bios_gp106.h" 30#include "gp106/bios_gp106.h"
31#include "ctrl/ctrltherm.h" 31#include "ctrl/ctrltherm.h"
32 32
33static u32 _therm_device_pmudata_instget(struct gk20a *g, 33static int _therm_device_pmudata_instget(struct gk20a *g,
34 struct nv_pmu_boardobjgrp *pmuboardobjgrp, 34 struct nv_pmu_boardobjgrp *pmuboardobjgrp,
35 struct nv_pmu_boardobj **ppboardobjpmudata, 35 struct nv_pmu_boardobj **ppboardobjpmudata,
36 u8 idx) 36 u8 idx)
@@ -54,29 +54,29 @@ static u32 _therm_device_pmudata_instget(struct gk20a *g,
54 return 0; 54 return 0;
55} 55}
56 56
57static u32 construct_therm_device(struct gk20a *g, 57static int construct_therm_device(struct gk20a *g,
58 struct boardobj **ppboardobj, u16 size, void *pargs) 58 struct boardobj **ppboardobj, u16 size, void *pargs)
59{ 59{
60 return boardobj_construct_super(g, ppboardobj, size, pargs); 60 return boardobj_construct_super(g, ppboardobj, size, pargs);
61} 61}
62 62
63static u32 construct_therm_device_gpu(struct gk20a *g, 63static int construct_therm_device_gpu(struct gk20a *g,
64 struct boardobj **ppboardobj, u16 size, void *pargs) 64 struct boardobj **ppboardobj, u16 size, void *pargs)
65{ 65{
66 return construct_therm_device(g, ppboardobj, size, pargs); 66 return construct_therm_device(g, ppboardobj, size, pargs);
67} 67}
68 68
69static u32 construct_therm_device_gpu_sci(struct gk20a *g, 69static int construct_therm_device_gpu_sci(struct gk20a *g,
70 struct boardobj **ppboardobj, u16 size, void *pargs) 70 struct boardobj **ppboardobj, u16 size, void *pargs)
71{ 71{
72 return construct_therm_device(g, ppboardobj, size, pargs); 72 return construct_therm_device(g, ppboardobj, size, pargs);
73} 73}
74 74
75 75
76static u32 therm_device_pmu_data_init_gpu_gpc_tsosc(struct gk20a *g, 76static int therm_device_pmu_data_init_gpu_gpc_tsosc(struct gk20a *g,
77 struct boardobj *pboard_obj, struct nv_pmu_boardobj *ppmudata) 77 struct boardobj *pboard_obj, struct nv_pmu_boardobj *ppmudata)
78{ 78{
79 u32 status = 0; 79 int status = 0;
80 struct therm_device_gpu_gpc_tsosc *pdev = NULL; 80 struct therm_device_gpu_gpc_tsosc *pdev = NULL;
81 struct nv_pmu_therm_therm_device_gpu_gpc_tsosc_boardobj_set *pset; 81 struct nv_pmu_therm_therm_device_gpu_gpc_tsosc_boardobj_set *pset;
82 82
@@ -95,13 +95,13 @@ exit:
95 return status; 95 return status;
96} 96}
97 97
98static u32 construct_therm_device_gpu_tsosc(struct gk20a *g, 98static int construct_therm_device_gpu_tsosc(struct gk20a *g,
99 struct boardobj **ppboardobj, u16 size, void *pargs) 99 struct boardobj **ppboardobj, u16 size, void *pargs)
100{ 100{
101 struct therm_device_gpu_gpc_tsosc *pdev = NULL; 101 struct therm_device_gpu_gpc_tsosc *pdev = NULL;
102 struct therm_device_gpu_gpc_tsosc *ptmp_dev = 102 struct therm_device_gpu_gpc_tsosc *ptmp_dev =
103 (struct therm_device_gpu_gpc_tsosc *)pargs; 103 (struct therm_device_gpu_gpc_tsosc *)pargs;
104 u32 status = 0; 104 int status = 0;
105 105
106 status = construct_therm_device(g, ppboardobj, size, pargs); 106 status = construct_therm_device(g, ppboardobj, size, pargs);
107 if (status != 0) { 107 if (status != 0) {
@@ -118,10 +118,10 @@ static u32 construct_therm_device_gpu_tsosc(struct gk20a *g,
118 return status; 118 return status;
119} 119}
120 120
121static u32 therm_device_pmu_data_init_hbm2_site(struct gk20a *g, 121static int therm_device_pmu_data_init_hbm2_site(struct gk20a *g,
122 struct boardobj *pboard_obj, struct nv_pmu_boardobj *ppmudata) 122 struct boardobj *pboard_obj, struct nv_pmu_boardobj *ppmudata)
123{ 123{
124 u32 status = 0; 124 int status = 0;
125 struct therm_device_hbm2_site *pdev = NULL; 125 struct therm_device_hbm2_site *pdev = NULL;
126 struct nv_pmu_therm_therm_device_hbm2_site_boardobj_set *pset; 126 struct nv_pmu_therm_therm_device_hbm2_site_boardobj_set *pset;
127 127
@@ -140,13 +140,13 @@ exit:
140 return status; 140 return status;
141} 141}
142 142
143static u32 construct_therm_device_hbm2_site(struct gk20a *g, 143static int construct_therm_device_hbm2_site(struct gk20a *g,
144 struct boardobj **ppboardobj, u16 size, void *pargs) 144 struct boardobj **ppboardobj, u16 size, void *pargs)
145{ 145{
146 struct therm_device_hbm2_site *pdev = NULL; 146 struct therm_device_hbm2_site *pdev = NULL;
147 struct therm_device_hbm2_site *ptmp_dev = 147 struct therm_device_hbm2_site *ptmp_dev =
148 (struct therm_device_hbm2_site *)pargs; 148 (struct therm_device_hbm2_site *)pargs;
149 u32 status = 0; 149 int status = 0;
150 150
151 status = construct_therm_device(g, ppboardobj, size, pargs); 151 status = construct_therm_device(g, ppboardobj, size, pargs);
152 if (status != 0) { 152 if (status != 0) {
@@ -163,7 +163,7 @@ static u32 construct_therm_device_hbm2_site(struct gk20a *g,
163 return status; 163 return status;
164} 164}
165 165
166static u32 construct_therm_device_hbm2_combined(struct gk20a *g, 166static int construct_therm_device_hbm2_combined(struct gk20a *g,
167 struct boardobj **ppboardobj, u16 size, void *pargs) 167 struct boardobj **ppboardobj, u16 size, void *pargs)
168{ 168{
169 return construct_therm_device(g, ppboardobj, size, pargs); 169 return construct_therm_device(g, ppboardobj, size, pargs);
@@ -174,7 +174,7 @@ static struct boardobj *therm_device_construct(struct gk20a *g,
174 void *pargs) 174 void *pargs)
175{ 175{
176 struct boardobj *board_obj_ptr = NULL; 176 struct boardobj *board_obj_ptr = NULL;
177 u32 status = 0; 177 int status = 0;
178 178
179 switch (BOARDOBJ_GET_TYPE(pargs)) { 179 switch (BOARDOBJ_GET_TYPE(pargs)) {
180 case NV_VBIOS_THERM_DEVICE_1X_ENTRY_CLASS_GPU: 180 case NV_VBIOS_THERM_DEVICE_1X_ENTRY_CLASS_GPU:
@@ -216,10 +216,10 @@ static struct boardobj *therm_device_construct(struct gk20a *g,
216 return board_obj_ptr; 216 return board_obj_ptr;
217} 217}
218 218
219static u32 devinit_get_therm_device_table(struct gk20a *g, 219static int devinit_get_therm_device_table(struct gk20a *g,
220 struct therm_devices *pthermdeviceobjs) 220 struct therm_devices *pthermdeviceobjs)
221{ 221{
222 u32 status = 0; 222 int status = 0;
223 u8 *therm_device_table_ptr = NULL; 223 u8 *therm_device_table_ptr = NULL;
224 u8 *curr_therm_device_table_ptr = NULL; 224 u8 *curr_therm_device_table_ptr = NULL;
225 struct boardobj *boardobj; 225 struct boardobj *boardobj;
@@ -324,9 +324,9 @@ done:
324 return status; 324 return status;
325} 325}
326 326
327u32 therm_device_sw_setup(struct gk20a *g) 327int therm_device_sw_setup(struct gk20a *g)
328{ 328{
329 u32 status; 329 int status;
330 struct boardobjgrp *pboardobjgrp = NULL; 330 struct boardobjgrp *pboardobjgrp = NULL;
331 struct therm_devices *pthermdeviceobjs; 331 struct therm_devices *pthermdeviceobjs;
332 332
diff --git a/drivers/gpu/nvgpu/therm/thrmdev.h b/drivers/gpu/nvgpu/therm/thrmdev.h
index af349c88..df4c199a 100644
--- a/drivers/gpu/nvgpu/therm/thrmdev.h
+++ b/drivers/gpu/nvgpu/therm/thrmdev.h
@@ -1,7 +1,7 @@
1/* 1/*
2 * general thermal device structures & definitions 2 * general thermal device structures & definitions
3 * 3 *
4 * Copyright (c) 2016, 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"),
@@ -53,6 +53,6 @@ struct therm_device_hbm2_combined {
53 struct therm_device super; 53 struct therm_device super;
54}; 54};
55 55
56u32 therm_device_sw_setup(struct gk20a *g); 56int therm_device_sw_setup(struct gk20a *g);
57 57
58#endif 58#endif
diff --git a/drivers/gpu/nvgpu/therm/thrmpmu.c b/drivers/gpu/nvgpu/therm/thrmpmu.c
index 6a79cc3e..7814cf5e 100644
--- a/drivers/gpu/nvgpu/therm/thrmpmu.c
+++ b/drivers/gpu/nvgpu/therm/thrmpmu.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (c) 2016-2017, NVIDIA CORPORATION. All rights reserved. 2 * Copyright (c) 2016-2018, NVIDIA CORPORATION. All rights reserved.
3 * 3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a 4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"), 5 * copy of this software and associated documentation files (the "Software"),
@@ -50,9 +50,9 @@ static void therm_pmucmdhandler(struct gk20a *g, struct pmu_msg *msg,
50 phandlerparams->success = 1; 50 phandlerparams->success = 1;
51} 51}
52 52
53u32 therm_send_pmgr_tables_to_pmu(struct gk20a *g) 53int therm_send_pmgr_tables_to_pmu(struct gk20a *g)
54{ 54{
55 u32 status = 0; 55 int status = 0;
56 struct boardobjgrp *pboardobjgrp = NULL; 56 struct boardobjgrp *pboardobjgrp = NULL;
57 57
58 if (!BOARDOBJGRP_IS_EMPTY(&g->therm_pmu.therm_deviceobjs.super.super)) { 58 if (!BOARDOBJGRP_IS_EMPTY(&g->therm_pmu.therm_deviceobjs.super.super)) {
diff --git a/drivers/gpu/nvgpu/therm/thrmpmu.h b/drivers/gpu/nvgpu/therm/thrmpmu.h
index 1813ce6c..1341a055 100644
--- a/drivers/gpu/nvgpu/therm/thrmpmu.h
+++ b/drivers/gpu/nvgpu/therm/thrmpmu.h
@@ -1,7 +1,7 @@
1/* 1/*
2 * general thermal pmu control structures & definitions 2 * general thermal pmu control structures & definitions
3 * 3 *
4 * Copyright (c) 2016, 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"),
@@ -24,7 +24,7 @@
24#ifndef _THRMPMU_H_ 24#ifndef _THRMPMU_H_
25#define _THRMPMU_H_ 25#define _THRMPMU_H_
26 26
27u32 therm_send_pmgr_tables_to_pmu(struct gk20a *g); 27int therm_send_pmgr_tables_to_pmu(struct gk20a *g);
28 28
29u32 therm_configure_therm_alert(struct gk20a *g); 29u32 therm_configure_therm_alert(struct gk20a *g);
30 30