summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/common/sim.c
diff options
context:
space:
mode:
authorNicolas Benech <nbenech@nvidia.com>2018-09-04 21:38:13 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2018-09-06 19:15:23 -0400
commit4451cf29d46cee3415e4dce42a8f67f3cc49070c (patch)
tree70107d4b7de329b0feaf855071aee7359dd78fbf /drivers/gpu/nvgpu/common/sim.c
parentba1245d8f74816189af0fc3e0d0d1c642f87cdf2 (diff)
gpu: nvgpu: Fix nvgpu_sim_esc_readl MISRA 17.7 violations
MISRA Rule-17.7 requires the return value of all functions to be used. Fix is either to use the return value or change the function to return void. This patch contains fix for calls to nvgpu_sim_esc_readl by changing its return to void and printing an error message instead. JIRA NVGPU-677 Change-Id: I949bea253dafc316c7dfbf870eb1225b6fc5b9c3 Signed-off-by: Nicolas Benech <nbenech@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1812887 Reviewed-by: Alex Waterman <alexw@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/common/sim.c')
-rw-r--r--drivers/gpu/nvgpu/common/sim.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/gpu/nvgpu/common/sim.c b/drivers/gpu/nvgpu/common/sim.c
index 8261f270..618e8ffb 100644
--- a/drivers/gpu/nvgpu/common/sim.c
+++ b/drivers/gpu/nvgpu/common/sim.c
@@ -28,6 +28,7 @@
28#include <nvgpu/hw_sim.h> 28#include <nvgpu/hw_sim.h>
29#include <nvgpu/sim.h> 29#include <nvgpu/sim.h>
30#include <nvgpu/utils.h> 30#include <nvgpu/utils.h>
31#include <nvgpu/bug.h>
31 32
32#include "gk20a/gk20a.h" 33#include "gk20a/gk20a.h"
33 34
@@ -215,7 +216,7 @@ static int issue_rpc_and_wait(struct gk20a *g)
215 return 0; 216 return 0;
216} 217}
217 218
218static int nvgpu_sim_esc_readl(struct gk20a *g, 219static void nvgpu_sim_esc_readl(struct gk20a *g,
219 char *path, u32 index, u32 *data) 220 char *path, u32 index, u32 *data)
220{ 221{
221 int err; 222 int err;
@@ -232,9 +233,12 @@ static int nvgpu_sim_esc_readl(struct gk20a *g,
232 233
233 err = issue_rpc_and_wait(g); 234 err = issue_rpc_and_wait(g);
234 235
235 if (!err) 236 if (err == 0) {
236 memcpy(data, sim_msg_param(g, data_offset), sizeof(u32)); 237 memcpy(data, sim_msg_param(g, data_offset), sizeof(u32));
237 return err; 238 } else {
239 *data = 0xffffffff;
240 WARN(1, "issue_rpc_and_wait failed err=%d", err);
241 }
238} 242}
239 243
240static void nvgpu_sim_init_late(struct gk20a *g) 244static void nvgpu_sim_init_late(struct gk20a *g)