From b5d3cf444eeeb62a593365532b22e44f9360a484 Mon Sep 17 00:00:00 2001 From: Alex Waterman Date: Wed, 21 Feb 2018 15:59:56 -0800 Subject: gpu: nvgpu: Cleanup unused variables There are numerous places where variables are assigned to but then never used. This patch cleans up all these unused variables and in some cases simplifies surrounding logic. Also delete unused header includes and add necessary header includes. JIRA NVGPU-525 Signed-off-by: Alex Waterman Change-Id: Ice9ec2a0e97f262d0dcfebe22f83208dbea569d9 Reviewed-on: https://git-master.nvidia.com/r/1662548 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/gk20a/fifo_gk20a.c | 19 +++---------------- drivers/gpu/nvgpu/gk20a/gr_gk20a.c | 6 ------ drivers/gpu/nvgpu/gk20a/mc_gk20a.c | 2 -- 3 files changed, 3 insertions(+), 24 deletions(-) (limited to 'drivers/gpu/nvgpu/gk20a') diff --git a/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c b/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c index 884e4a02..fea46a0e 100644 --- a/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c @@ -1215,9 +1215,7 @@ void gk20a_fifo_get_mmu_fault_info(struct gk20a *g, u32 mmu_fault_id, void gk20a_fifo_reset_engine(struct gk20a *g, u32 engine_id) { - struct fifo_gk20a *f = NULL; u32 engine_enum = ENGINE_INVAL_GK20A; - u32 inst_id = 0; struct fifo_engine_info_gk20a *engine_info; gk20a_dbg_fn(""); @@ -1225,14 +1223,10 @@ void gk20a_fifo_reset_engine(struct gk20a *g, u32 engine_id) if (!g) return; - f = &g->fifo; - engine_info = gk20a_fifo_get_engine_info(g, engine_id); - if (engine_info) { + if (engine_info) engine_enum = engine_info->engine_enum; - inst_id = engine_info->inst_id; - } if (engine_enum == ENGINE_INVAL_GK20A) nvgpu_err(g, "unsupported engine_id %d", engine_id); @@ -1300,19 +1294,15 @@ bool gk20a_fifo_should_defer_engine_reset(struct gk20a *g, u32 engine_id, u32 engine_subid, bool fake_fault) { u32 engine_enum = ENGINE_INVAL_GK20A; - struct fifo_gk20a *fifo = NULL; struct fifo_engine_info_gk20a *engine_info; if (!g) return false; - fifo = &g->fifo; - engine_info = gk20a_fifo_get_engine_info(g, engine_id); - if (engine_info) { + if (engine_info) engine_enum = engine_info->engine_enum; - } if (engine_enum == ENGINE_INVAL_GK20A) return false; @@ -2974,7 +2964,6 @@ static void gk20a_fifo_runlist_reset_engines(struct gk20a *g, u32 runlist_id) static int gk20a_fifo_runlist_wait_pending(struct gk20a *g, u32 runlist_id) { - struct fifo_runlist_info_gk20a *runlist; struct nvgpu_timeout timeout; unsigned long delay = GR_IDLE_CHECK_DEFAULT; int ret = -ETIMEDOUT; @@ -2982,7 +2971,6 @@ static int gk20a_fifo_runlist_wait_pending(struct gk20a *g, u32 runlist_id) nvgpu_timeout_init(g, &timeout, gk20a_get_gr_idle_timeout(g), NVGPU_TIMER_CPU_TIMER); - runlist = &g->fifo.runlist_info[runlist_id]; do { if ((gk20a_readl(g, fifo_eng_runlist_r(runlist_id)) & fifo_eng_runlist_pending_true_f()) == 0) { @@ -3173,7 +3161,7 @@ static int gk20a_fifo_update_runlist_locked(struct gk20a *g, u32 runlist_id, struct fifo_runlist_info_gk20a *runlist = NULL; u32 *runlist_entry_base = NULL; u64 runlist_iova; - u32 old_buf, new_buf; + u32 new_buf; struct channel_gk20a *ch = NULL; struct tsg_gk20a *tsg = NULL; u32 count = 0; @@ -3205,7 +3193,6 @@ static int gk20a_fifo_update_runlist_locked(struct gk20a *g, u32 runlist_id, } } - old_buf = runlist->cur_buffer; new_buf = !runlist->cur_buffer; runlist_iova = nvgpu_mem_get_addr(g, &runlist->mem[new_buf]); diff --git a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c index ef26a74e..8db6b42f 100644 --- a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c @@ -22,8 +22,6 @@ * DEALINGS IN THE SOFTWARE. */ -#include - #include #include #include @@ -6171,14 +6169,10 @@ static int gr_gk20a_decode_priv_addr(struct gk20a *g, u32 addr, u32 *broadcast_flags) { u32 gpc_addr; - u32 ppc_address; - u32 ppc_broadcast_addr; gk20a_dbg(gpu_dbg_fn | gpu_dbg_gpu_dbg, "addr=0x%x", addr); /* setup defaults */ - ppc_address = 0; - ppc_broadcast_addr = 0; *addr_type = CTXSW_ADDR_TYPE_SYS; *broadcast_flags = PRI_BROADCAST_FLAGS_NONE; *gpc_num = 0; diff --git a/drivers/gpu/nvgpu/gk20a/mc_gk20a.c b/drivers/gpu/nvgpu/gk20a/mc_gk20a.c index 5027eaa4..b99fbdb0 100644 --- a/drivers/gpu/nvgpu/gk20a/mc_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/mc_gk20a.c @@ -22,8 +22,6 @@ * DEALINGS IN THE SOFTWARE. */ -#include - #include "gk20a.h" #include "mc_gk20a.h" -- cgit v1.2.2