Skip to contentSkip to conversation

drm/amdgpu: Make amdgpu_ring_mux functions as static

PATCH In review [email protected] 2 participants 2 messages Dec 5, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/amdgpu: Make amdgpu_ring_mux functions as static

From: Jiadong Zhu <[email protected]>

lkp robot reported missing-prototypes and unused-but-set-variable warnings on some functions of amdgpu_mcbp_mux.c. Make them static and remove the unused variable.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ring_mux.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_ring_mux.c +3 -5
index 3348337379da..62079f0e3ee8 100644
@@ -350,7 +350,7 @@ unsigned int amdgpu_sw_ring_priority(int idx)
 }
 
 /*Scan on low prio rings to have unsignaled fence and high ring has no fence.*/
-int amdgpu_mcbp_scan(struct amdgpu_ring_mux *mux)
+static int amdgpu_mcbp_scan(struct amdgpu_ring_mux *mux)
 {
 	struct amdgpu_ring *ring;
 	int i, need_preempt;
@@ -370,7 +370,7 @@ int amdgpu_mcbp_scan(struct amdgpu_ring_mux *mux)
 }
 
 /* Trigger Mid-Command Buffer Preemption (MCBP) and find if we need to resubmit. */
-int amdgpu_mcbp_trigger_preempt(struct amdgpu_ring_mux *mux)
+static int amdgpu_mcbp_trigger_preempt(struct amdgpu_ring_mux *mux)
 {
 	int r;
 
@@ -434,7 +434,7 @@ void amdgpu_ring_mux_start_ib(struct amdgpu_ring_mux *mux, struct amdgpu_ring *r
 
 static void scan_and_remove_signaled_chunk(struct amdgpu_ring_mux *mux, struct amdgpu_ring *ring)
 {
-	uint32_t last_seq, size = 0;
+	uint32_t last_seq = 0;
 	struct amdgpu_mux_entry *e;
 	struct amdgpu_mux_chunk *chunk, *tmp;
 
@@ -450,8 +450,6 @@ static void scan_and_remove_signaled_chunk(struct amdgpu_ring_mux *mux, struct a
 		if (chunk->sync_seq <= last_seq) {
 			list_del(&chunk->entry);
 			kmem_cache_free(amdgpu_mux_chunk_slab, chunk);
-		} else {
-			size++;
 		}
 	}
 }
Signature · 1 line
2.25.1
Reviewed-by on v1 1/1
#1 lore raw

Am 05.12.22 um 03:27 schrieb [email protected]:

Quoted 8 lines

From: Jiadong Zhu <[email protected]>

lkp robot reported missing-prototypes and unused-but-set-variable warnings on some functions of amdgpu_mcbp_mux.c. Make them static and remove the unused variable.

Quoted 44 lines
---
  drivers/gpu/drm/amd/amdgpu/amdgpu_ring_mux.c | 8 +++-----
  1 file changed, 3 insertions(+), 5 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_ring_mux.c +3 -5
index 3348337379da..62079f0e3ee8 100644
@@ -350,7 +350,7 @@ unsigned int amdgpu_sw_ring_priority(int idx)
  }
 
  /*Scan on low prio rings to have unsignaled fence and high ring has no fence.*/
-int amdgpu_mcbp_scan(struct amdgpu_ring_mux *mux)
+static int amdgpu_mcbp_scan(struct amdgpu_ring_mux *mux)
  {
  	struct amdgpu_ring *ring;
  	int i, need_preempt;
@@ -370,7 +370,7 @@ int amdgpu_mcbp_scan(struct amdgpu_ring_mux *mux)
  }
 
  /* Trigger Mid-Command Buffer Preemption (MCBP) and find if we need to resubmit. */
-int amdgpu_mcbp_trigger_preempt(struct amdgpu_ring_mux *mux)
+static int amdgpu_mcbp_trigger_preempt(struct amdgpu_ring_mux *mux)
  {
  	int r;
 
@@ -434,7 +434,7 @@ void amdgpu_ring_mux_start_ib(struct amdgpu_ring_mux *mux, struct amdgpu_ring *r
 
  static void scan_and_remove_signaled_chunk(struct amdgpu_ring_mux *mux, struct amdgpu_ring *ring)
  {
-	uint32_t last_seq, size = 0;
+	uint32_t last_seq = 0;
  	struct amdgpu_mux_entry *e;
  	struct amdgpu_mux_chunk *chunk, *tmp;
 
@@ -450,8 +450,6 @@ static void scan_and_remove_signaled_chunk(struct amdgpu_ring_mux *mux, struct a
  		if (chunk->sync_seq <= last_seq) {
  			list_del(&chunk->entry);
  			kmem_cache_free(amdgpu_mux_chunk_slab, chunk);
-		} else {
-			size++;
  		}
  	}
  }