From 4e4e76fd33f6317ccaa80a95f090a7603296ae12 Mon Sep 17 00:00:00 2001 From: Sagar Kamble Date: Mon, 3 Dec 2018 21:01:01 +0530 Subject: [PATCH] gpu: nvgpu: fix MISRA 5.6 violation Fix following MISRA 5.6 violation. kernel/nvgpu/drivers/gpu/nvgpu/common/pmu/acr_gm20b.c:50: Type: Coding standard violation (MISRA C-2012 Rule 5.6) kernel/nvgpu/drivers/gpu/nvgpu/common/pmu/acr_gm20b.c:50: 1. identifier_reuse: Identifier "get_ucode_details" is already used to represent a typedef. kernel/nvgpu/drivers/gpu/nvgpu/common/pmu/acr_gm20b.c:50: 2. typedef_declaration: Declaring a typedef with identifier "get_ucode_details" in remote file "acr_gp106.c". JIRA NVGPU-1459 Change-Id: Ic5848f251d3be955f20cabcb26a17021b08ae37f Signed-off-by: Sagar Kamble Reviewed-on: https://git-master.nvidia.com/r/1964439 Reviewed-by: svc-mobile-coverity Reviewed-by: svc-misra-checker GVS: Gerrit_Virtual_Submit Reviewed-by: Vijayakumar Subbu Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/common/pmu/acr_gm20b.c | 5 +++-- drivers/gpu/nvgpu/common/pmu/acr_gp106.c | 6 +++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/nvgpu/common/pmu/acr_gm20b.c b/drivers/gpu/nvgpu/common/pmu/acr_gm20b.c index e78b0136f..f77a79fce 100644 --- a/drivers/gpu/nvgpu/common/pmu/acr_gm20b.c +++ b/drivers/gpu/nvgpu/common/pmu/acr_gm20b.c @@ -47,7 +47,8 @@ #include #include -typedef int (*get_ucode_details)(struct gk20a *g, struct flcn_ucode_img *udata); +typedef int (*gm20b_get_ucode_details)(struct gk20a *g, + struct flcn_ucode_img *udata); /*Externs*/ @@ -69,7 +70,7 @@ static void lsfm_init_wpr_contents(struct gk20a *g, struct ls_flcn_mgr *plsfm, static void free_acr_resources(struct gk20a *g, struct ls_flcn_mgr *plsfm); /*Globals*/ -static get_ucode_details pmu_acr_supp_ucode_list[] = { +static gm20b_get_ucode_details pmu_acr_supp_ucode_list[] = { pmu_ucode_details, fecs_ucode_details, gpccs_ucode_details, diff --git a/drivers/gpu/nvgpu/common/pmu/acr_gp106.c b/drivers/gpu/nvgpu/common/pmu/acr_gp106.c index e36769800..440799b87 100644 --- a/drivers/gpu/nvgpu/common/pmu/acr_gp106.c +++ b/drivers/gpu/nvgpu/common/pmu/acr_gp106.c @@ -50,8 +50,8 @@ #define gp106_dbg_pmu(g, fmt, arg...) \ nvgpu_log(g, gpu_dbg_pmu, fmt, ##arg) -typedef int (*get_ucode_details)(struct gk20a *g, - struct flcn_ucode_img_v1 *udata); +typedef int (*gp106_get_ucode_details)(struct gk20a *g, + struct flcn_ucode_img_v1 *udata); /* Both size and address of WPR need to be 128K-aligned */ #define WPR_ALIGNMENT 0x20000 @@ -64,7 +64,7 @@ typedef int (*get_ucode_details)(struct gk20a *g, /*Forwards*/ /*Globals*/ -static get_ucode_details pmu_acr_supp_ucode_list[] = { +static gp106_get_ucode_details pmu_acr_supp_ucode_list[] = { pmu_ucode_details, fecs_ucode_details, gpccs_ucode_details,