From ed60c25d3840c9d198e7b4b5f852382b02ed64bd Mon Sep 17 00:00:00 2001 From: Vijayakumar Date: Mon, 1 May 2017 12:26:14 +0530 Subject: gpu: nvgpu: fix error for static code analysis use memset to fill structures with zero instead of assigning zero. mark functions local to the file as static fixing errors in clk, perf and therm modules. Bug 200299572 Change-Id: I0470298803c35b6faed2edc2a0c1dbf0e47e842e Signed-off-by: Vijayakumar Reviewed-on: http://git-master/r/1472940 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: svccoveritychecker Reviewed-by: Sachin Nikam GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom --- drivers/gpu/nvgpu/therm/thrmpmu.c | 32 ++++++++++++++++++++++---------- 1 file changed, 22 insertions(+), 10 deletions(-) (limited to 'drivers/gpu/nvgpu/therm') diff --git a/drivers/gpu/nvgpu/therm/thrmpmu.c b/drivers/gpu/nvgpu/therm/thrmpmu.c index 3d80eff3..84e9871a 100644 --- a/drivers/gpu/nvgpu/therm/thrmpmu.c +++ b/drivers/gpu/nvgpu/therm/thrmpmu.c @@ -115,11 +115,17 @@ exit: static u32 therm_set_warn_temp_limit(struct gk20a *g) { u32 seqdesc = 0; - struct pmu_cmd cmd = { {0} }; - struct pmu_msg msg = { {0} }; - struct pmu_payload payload = { {0} }; - struct nv_pmu_therm_rpc rpccall = {0}; - struct therm_pmucmdhandler_params handlerparams = {0}; + struct pmu_cmd cmd; + struct pmu_msg msg; + struct pmu_payload payload; + struct nv_pmu_therm_rpc rpccall; + struct therm_pmucmdhandler_params handlerparams; + + memset(&payload, 0, sizeof(struct pmu_payload)); + memset(&cmd, 0, sizeof(struct pmu_cmd)); + memset(&msg, 0, sizeof(struct pmu_msg)); + memset(&rpccall, 0, sizeof(struct nv_pmu_therm_rpc)); + memset(&handlerparams, 0, sizeof(struct therm_pmucmdhandler_params)); rpccall.function = NV_PMU_THERM_RPC_ID_SLCT_EVENT_TEMP_TH_SET; rpccall.params.slct_event_temp_th_set.event_id = @@ -178,11 +184,17 @@ static u32 therm_enable_slct_notification_request(struct gk20a *g) static u32 therm_send_slct_configuration_to_pmu(struct gk20a *g) { u32 seqdesc = 0; - struct pmu_cmd cmd = { {0} }; - struct pmu_msg msg = { {0} }; - struct pmu_payload payload = { {0} }; - struct nv_pmu_therm_rpc rpccall = {0}; - struct therm_pmucmdhandler_params handlerparams = {0}; + struct pmu_cmd cmd; + struct pmu_msg msg; + struct pmu_payload payload; + struct nv_pmu_therm_rpc rpccall; + struct therm_pmucmdhandler_params handlerparams; + + memset(&payload, 0, sizeof(struct pmu_payload)); + memset(&cmd, 0, sizeof(struct pmu_cmd)); + memset(&msg, 0, sizeof(struct pmu_msg)); + memset(&rpccall, 0, sizeof(struct nv_pmu_therm_rpc)); + memset(&handlerparams, 0, sizeof(struct therm_pmucmdhandler_params)); rpccall.function = NV_PMU_THERM_RPC_ID_SLCT; rpccall.params.slct.mask_enabled = -- cgit v1.2.2