From a8771926414d7a16604b70c673a64a8ca3da0f8c Mon Sep 17 00:00:00 2001 From: Philip Elcan Date: Thu, 19 Sep 2019 16:24:13 -0400 Subject: [PATCH] gpu: nvgpu: sec2: update sec2 API Remove the second parameter for the nvgpu_init_sec2_setup_sw() function so the function only requires the gk20a object. The g->sec2 was always passed for this parameter. And this makes the API signature match the other init functions in the driver. JIRA NVGPU-3980 Change-Id: I22f526d961da44da64d563f5f3136c62cf9f4adf Signed-off-by: Philip Elcan Reviewed-on: https://git-master.nvidia.com/r/2202970 Reviewed-by: svc-mobile-coverity Reviewed-by: svc-mobile-misra Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Vinod Gopalakrishnakurup Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/common/init/nvgpu_init.c | 2 +- drivers/gpu/nvgpu/common/sec2/sec2.c | 12 ++++++------ drivers/gpu/nvgpu/include/nvgpu/gk20a.h | 3 +-- drivers/gpu/nvgpu/include/nvgpu/sec2/sec2.h | 2 +- 4 files changed, 9 insertions(+), 10 deletions(-) diff --git a/drivers/gpu/nvgpu/common/init/nvgpu_init.c b/drivers/gpu/nvgpu/common/init/nvgpu_init.c index 48dfac995..0c696c356 100644 --- a/drivers/gpu/nvgpu/common/init/nvgpu_init.c +++ b/drivers/gpu/nvgpu/common/init/nvgpu_init.c @@ -354,7 +354,7 @@ int nvgpu_finalize_poweron(struct gk20a *g) #ifdef CONFIG_NVGPU_DGPU if (nvgpu_is_enabled(g, NVGPU_SUPPORT_SEC2_RTOS)) { - err = g->ops.sec2.init_sec2_setup_sw(g, &g->sec2); + err = g->ops.sec2.init_sec2_setup_sw(g); if (err != 0) { nvgpu_err(g, "failed to init sec2 sw setup"); goto done; diff --git a/drivers/gpu/nvgpu/common/sec2/sec2.c b/drivers/gpu/nvgpu/common/sec2/sec2.c index 6336f737c..78d5058fe 100644 --- a/drivers/gpu/nvgpu/common/sec2/sec2.c +++ b/drivers/gpu/nvgpu/common/sec2/sec2.c @@ -38,24 +38,24 @@ static void nvgpu_remove_sec2_support(struct nvgpu_sec2 *sec2) nvgpu_mutex_destroy(&sec2->isr_mutex); } -int nvgpu_init_sec2_setup_sw(struct gk20a *g, struct nvgpu_sec2 *sec2) +int nvgpu_init_sec2_setup_sw(struct gk20a *g) { int err = 0; nvgpu_log_fn(g, " "); - sec2->g = g; + g->sec2.g = g; - err = nvgpu_sec2_sequences_alloc(g, &sec2->sequences); + err = nvgpu_sec2_sequences_alloc(g, &g->sec2.sequences); if (err != 0) { return err; } - nvgpu_sec2_sequences_init(g, &sec2->sequences); + nvgpu_sec2_sequences_init(g, &g->sec2.sequences); - nvgpu_mutex_init(&sec2->isr_mutex); + nvgpu_mutex_init(&g->sec2.isr_mutex); - sec2->remove_support = nvgpu_remove_sec2_support; + g->sec2.remove_support = nvgpu_remove_sec2_support; return err; } diff --git a/drivers/gpu/nvgpu/include/nvgpu/gk20a.h b/drivers/gpu/nvgpu/include/nvgpu/gk20a.h index 66d00fd0d..759fe25d0 100644 --- a/drivers/gpu/nvgpu/include/nvgpu/gk20a.h +++ b/drivers/gpu/nvgpu/include/nvgpu/gk20a.h @@ -1679,8 +1679,7 @@ struct gpu_ops { u32 value); } top; struct { - int (*init_sec2_setup_sw)(struct gk20a *g, - struct nvgpu_sec2 *sec2); + int (*init_sec2_setup_sw)(struct gk20a *g); int (*init_sec2_support)(struct gk20a *g); int (*sec2_destroy)(struct gk20a *g); void (*secured_sec2_start)(struct gk20a *g); diff --git a/drivers/gpu/nvgpu/include/nvgpu/sec2/sec2.h b/drivers/gpu/nvgpu/include/nvgpu/sec2/sec2.h index 046801672..3849c2299 100644 --- a/drivers/gpu/nvgpu/include/nvgpu/sec2/sec2.h +++ b/drivers/gpu/nvgpu/include/nvgpu/sec2/sec2.h @@ -64,7 +64,7 @@ struct nvgpu_sec2 { }; /* sec2 init */ -int nvgpu_init_sec2_setup_sw(struct gk20a *g, struct nvgpu_sec2 *sec2); +int nvgpu_init_sec2_setup_sw(struct gk20a *g); int nvgpu_init_sec2_support(struct gk20a *g); int nvgpu_sec2_destroy(struct gk20a *g);