From a13917213052be93d2fe0db60b6f44d46b942816 Mon Sep 17 00:00:00 2001 From: Scott Long Date: Tue, 13 Aug 2019 19:47:13 -0700 Subject: [PATCH] gpu: nvgpu: mm: fix misra 2.7 violation Advisory Rule 2.7 states that there should be no unused parameters in functions. This patch removes the unused struct gk20a pointer from the nvgpu_aperture_str() function. Jira NVGPU-3178 Change-Id: Ied7fed13e44f1083e7477a5d6fb9facafca838de Signed-off-by: Scott Long Reviewed-on: https://git-master.nvidia.com/r/2174883 Reviewed-by: svc-mobile-coverity Reviewed-by: svc-mobile-misra GVS: Gerrit_Virtual_Submit Reviewed-by: Philip Elcan Reviewed-by: Alex Waterman Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/common/mm/gmmu/page_table.c | 2 +- drivers/gpu/nvgpu/hal/mm/gmmu/gmmu_gk20a.c | 2 +- drivers/gpu/nvgpu/hal/mm/gmmu/gmmu_gp10b_fusa.c | 4 ++-- drivers/gpu/nvgpu/include/nvgpu/nvgpu_mem.h | 3 +-- drivers/gpu/nvgpu/os/linux/vm.c | 3 +-- 5 files changed, 6 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/nvgpu/common/mm/gmmu/page_table.c b/drivers/gpu/nvgpu/common/mm/gmmu/page_table.c index fce9b6b19..16e99e759 100644 --- a/drivers/gpu/nvgpu/common/mm/gmmu/page_table.c +++ b/drivers/gpu/nvgpu/common/mm/gmmu/page_table.c @@ -760,7 +760,7 @@ static int nvgpu_gmmu_update_page_table(struct vm_gk20a *vm, page_size >> 10, nvgpu_gmmu_perm_str(attrs->rw_flag), attrs->kind_v, - nvgpu_aperture_str(g, attrs->aperture), + nvgpu_aperture_str(attrs->aperture), attrs->cacheable ? 'C' : '-', attrs->sparse ? 'S' : '-', attrs->priv ? 'P' : '-', diff --git a/drivers/gpu/nvgpu/hal/mm/gmmu/gmmu_gk20a.c b/drivers/gpu/nvgpu/hal/mm/gmmu/gmmu_gk20a.c index 5d4a39989..1ea947d95 100644 --- a/drivers/gpu/nvgpu/hal/mm/gmmu/gmmu_gk20a.c +++ b/drivers/gpu/nvgpu/hal/mm/gmmu/gmmu_gk20a.c @@ -221,7 +221,7 @@ static void update_gmmu_pte_locked(struct vm_gk20a *vm, page_size >> 10, nvgpu_gmmu_perm_str(attrs->rw_flag), attrs->kind_v, - nvgpu_aperture_str(g, attrs->aperture), + nvgpu_aperture_str(attrs->aperture), attrs->cacheable ? 'C' : '-', attrs->sparse ? 'S' : '-', attrs->priv ? 'P' : '-', diff --git a/drivers/gpu/nvgpu/hal/mm/gmmu/gmmu_gp10b_fusa.c b/drivers/gpu/nvgpu/hal/mm/gmmu/gmmu_gp10b_fusa.c index fd0ce0ff1..e17b834cd 100644 --- a/drivers/gpu/nvgpu/hal/mm/gmmu/gmmu_gp10b_fusa.c +++ b/drivers/gpu/nvgpu/hal/mm/gmmu/gmmu_gp10b_fusa.c @@ -273,7 +273,7 @@ static void update_gmmu_pte_locked(struct vm_gk20a *vm, page_size >> 10, nvgpu_gmmu_perm_str(attrs->rw_flag), attrs->kind_v, - nvgpu_aperture_str(g, attrs->aperture), + nvgpu_aperture_str(attrs->aperture), attrs->cacheable ? 'C' : '-', attrs->sparse ? 'S' : '-', attrs->priv ? 'P' : '-', @@ -294,7 +294,7 @@ static void update_gmmu_pte_locked(struct vm_gk20a *vm, page_size >> 10, nvgpu_gmmu_perm_str(attrs->rw_flag), attrs->kind_v, - nvgpu_aperture_str(g, attrs->aperture), + nvgpu_aperture_str(attrs->aperture), attrs->cacheable ? 'C' : '-', attrs->sparse ? 'S' : '-', attrs->priv ? 'P' : '-', diff --git a/drivers/gpu/nvgpu/include/nvgpu/nvgpu_mem.h b/drivers/gpu/nvgpu/include/nvgpu/nvgpu_mem.h index e3b271d5a..d295c3e17 100644 --- a/drivers/gpu/nvgpu/include/nvgpu/nvgpu_mem.h +++ b/drivers/gpu/nvgpu/include/nvgpu/nvgpu_mem.h @@ -159,8 +159,7 @@ static const char *aperture_name[APERTURE_MAX_ENUM + 1] = { [APERTURE_MAX_ENUM] = "UNKNOWN", }; -static inline const char *nvgpu_aperture_str(struct gk20a *g, - enum nvgpu_aperture aperture) +static inline const char *nvgpu_aperture_str(enum nvgpu_aperture aperture) { if ((aperture < APERTURE_INVALID) || (aperture >= APERTURE_MAX_ENUM)) { return aperture_name[APERTURE_MAX_ENUM]; diff --git a/drivers/gpu/nvgpu/os/linux/vm.c b/drivers/gpu/nvgpu/os/linux/vm.c index 5ab543834..0cf978a5a 100644 --- a/drivers/gpu/nvgpu/os/linux/vm.c +++ b/drivers/gpu/nvgpu/os/linux/vm.c @@ -171,8 +171,7 @@ struct nvgpu_mapped_buf *nvgpu_vm_find_mapping(struct vm_gk20a *vm, vm->gmmu_page_sizes[mapped_buffer->pgsz_idx] >> 10, vm_aspace_id(vm), mapped_buffer->flags, - nvgpu_aperture_str(g, - gk20a_dmabuf_aperture(g, os_buf->dmabuf))); + nvgpu_aperture_str(gk20a_dmabuf_aperture(g, os_buf->dmabuf))); return mapped_buffer; }