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/pmgr/pmgrpmu.c | |
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/pmgr/pmgrpmu.c')
-rw-r--r-- | drivers/gpu/nvgpu/pmgr/pmgrpmu.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/drivers/gpu/nvgpu/pmgr/pmgrpmu.c b/drivers/gpu/nvgpu/pmgr/pmgrpmu.c index 3398e8df..69c43a01 100644 --- a/drivers/gpu/nvgpu/pmgr/pmgrpmu.c +++ b/drivers/gpu/nvgpu/pmgr/pmgrpmu.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"), |
@@ -175,11 +175,11 @@ static u32 pmgr_send_i2c_device_topology_to_pmu(struct gk20a *g) | |||
175 | return status; | 175 | return status; |
176 | } | 176 | } |
177 | 177 | ||
178 | static u32 pmgr_send_pwr_device_topology_to_pmu(struct gk20a *g) | 178 | static int pmgr_send_pwr_device_topology_to_pmu(struct gk20a *g) |
179 | { | 179 | { |
180 | struct nv_pmu_pmgr_pwr_device_desc_table *pwr_desc_table; | 180 | struct nv_pmu_pmgr_pwr_device_desc_table *pwr_desc_table; |
181 | struct nv_pmu_pmgr_pwr_device_desc_table_header *ppwr_desc_header; | 181 | struct nv_pmu_pmgr_pwr_device_desc_table_header *ppwr_desc_header; |
182 | u32 status = 0; | 182 | int status = 0; |
183 | 183 | ||
184 | /* Set the BA-device-independent HW information */ | 184 | /* Set the BA-device-independent HW information */ |
185 | pwr_desc_table = nvgpu_kzalloc(g, sizeof(*pwr_desc_table)); | 185 | pwr_desc_table = nvgpu_kzalloc(g, sizeof(*pwr_desc_table)); |
@@ -221,13 +221,13 @@ exit: | |||
221 | return status; | 221 | return status; |
222 | } | 222 | } |
223 | 223 | ||
224 | static u32 pmgr_send_pwr_mointer_to_pmu(struct gk20a *g) | 224 | static int pmgr_send_pwr_mointer_to_pmu(struct gk20a *g) |
225 | { | 225 | { |
226 | struct nv_pmu_pmgr_pwr_monitor_pack *pwr_monitor_pack = NULL; | 226 | struct nv_pmu_pmgr_pwr_monitor_pack *pwr_monitor_pack = NULL; |
227 | struct nv_pmu_pmgr_pwr_channel_header *pwr_channel_hdr; | 227 | struct nv_pmu_pmgr_pwr_channel_header *pwr_channel_hdr; |
228 | struct nv_pmu_pmgr_pwr_chrelationship_header *pwr_chrelationship_header; | 228 | struct nv_pmu_pmgr_pwr_chrelationship_header *pwr_chrelationship_header; |
229 | u32 max_dmem_size; | 229 | u32 max_dmem_size; |
230 | u32 status = 0; | 230 | int status = 0; |
231 | 231 | ||
232 | pwr_monitor_pack = nvgpu_kzalloc(g, sizeof(*pwr_monitor_pack)); | 232 | pwr_monitor_pack = nvgpu_kzalloc(g, sizeof(*pwr_monitor_pack)); |
233 | if (!pwr_monitor_pack) | 233 | if (!pwr_monitor_pack) |
@@ -290,11 +290,11 @@ exit: | |||
290 | return status; | 290 | return status; |
291 | } | 291 | } |
292 | 292 | ||
293 | static u32 pmgr_send_pwr_policy_to_pmu(struct gk20a *g) | 293 | static int pmgr_send_pwr_policy_to_pmu(struct gk20a *g) |
294 | { | 294 | { |
295 | struct nv_pmu_pmgr_pwr_policy_pack *ppwrpack = NULL; | 295 | struct nv_pmu_pmgr_pwr_policy_pack *ppwrpack = NULL; |
296 | struct pwr_policy *ppolicy = NULL; | 296 | struct pwr_policy *ppolicy = NULL; |
297 | u32 status = 0; | 297 | int status = 0; |
298 | u8 indx; | 298 | u8 indx; |
299 | u32 max_dmem_size; | 299 | u32 max_dmem_size; |
300 | 300 | ||
@@ -479,9 +479,9 @@ exit: | |||
479 | return status; | 479 | return status; |
480 | } | 480 | } |
481 | 481 | ||
482 | u32 pmgr_send_pmgr_tables_to_pmu(struct gk20a *g) | 482 | int pmgr_send_pmgr_tables_to_pmu(struct gk20a *g) |
483 | { | 483 | { |
484 | u32 status = 0; | 484 | int status = 0; |
485 | 485 | ||
486 | status = pmgr_send_i2c_device_topology_to_pmu(g); | 486 | status = pmgr_send_i2c_device_topology_to_pmu(g); |
487 | 487 | ||